buegelfrei

Bring Your Business to LifeSupportWordPress: Popular Widget Plugin 100K downloads

Forum Replies Created

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • in reply to: Inserting Custom Field Contents into Tab Post Content #55339
    buegelfrei
    Participant

    Solved!

    It seems that the plugin I was using to create my custom field was the culprit. Once I realized that WP had custom field functionality already built in, I found that adding the following to display_post_tab_content was all I needed to display a WP-generated custom field in tab post content:

    $output .= 
    '<span class="myClass">'. get_post_meta($post->ID, 'myCustomField', true) . '</span> ';

    (My solution did not work for the custom field created via the plugin which shall remain nameless. Disabled and deleted!)

    Thanks again for Popular Widget!

    in reply to: Inserting Custom Field Contents into Tab Post Content #55311
    buegelfrei
    Participant

    I think I just figured out how to do it. I’ll post my solution here, if it works…

    in reply to: Inserting Custom Field Contents into Tab Post Content #55301
    buegelfrei
    Participant

    I must be doing something wrong: just working with your starter code, I would expect to see each title get “add something after the title” added to it. Instead, the titles are gone altogether under the “Recent” tab. (The titles are still there under Popular and Commented, the other two tabs that I’m using).

    I’ve got this at line 382 in functions.php:

    function add_replace_title_on_post_tab( $title ){
    $title . "add something after the title";
    return $title;
    }

    And this at the last line of the file:
    add_filter( 'pop_recent_title', 'add_replace_title_on_post_tab' );

    Thanks!

Viewing 3 posts - 1 through 3 (of 3 total)