Forums

Conditional tag if meta is not empty (3 posts)

  1. Beee
    Member
    Posted 3 months ago #

    I want to create a conditional tag which displays the comments or not.

    If custom field 'thumb' = not empty then they must be shown, otherwise not.
    Couldn't find anything on http://codex.wordpress.org/Conditional_Tags or anywhere in the codex

  2. Beee
    Member
    Posted 3 months ago #

    PS all values are different so I can't select on where thumb=some_value

  3. sa3ied
    Member
    Posted 1 month ago #

    $key = "thumb";
    $thumb = get_post_meta($post->ID, $key, true);
    if (!$thumb){
    echo "";
    }else{
    echo "Place your comments here";
    }

    Good luck

Reply

You must log in to post.

About this Topic