Forums

POST META HELP (3 posts)

  1. teckn1caLity
    Member
    Posted 6 months ago #

    <?php
        $producer = get_post_meta($post->ID, 'producer', true);
        _e($producer);
    ?>

    [Please post code snippets between backticks or use the code button.]

    That's a snippet of some post meta info I retrieve on my index posts. Where I insert it in my index.php, and the post doesn't contain that post meta info, there's a big gap between the title and body where the post meta info would go if there was post meta info (IE. only certain categories require it for my posts ). How would I go about eliminating that space if there was no post meta info?

    More clarification can be made.

  2. esmi
    Theme Diva & Forum Moderator
    Posted 6 months ago #

    Try:

    <?php
    if( get_post_meta($post->ID, 'producer', true) )
    $producer = get_post_meta($post->ID, 'producer', true);
        _e($producer);
    ?>
  3. teckn1caLity
    Member
    Posted 6 months ago #

    Worked perfectly, thanks for the help.

    Also, could you check out my previous thread concering the user meta info? For some reason the commands I posted aren't retreiving any information for my author templates, since like a week ago.

Reply

You must log in to post.

About this Topic

Tags

No tags yet.