Forums

[resolved] Conditional tag if meta is not empty (4 posts)

  1. Beee
    Member
    Posted 2 years 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 2 years ago #

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

  3. sa3ied
    Member
    Posted 2 years ago #

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

    Good luck

  4. Beee
    Member
    Posted 2 years ago #

    thanx a lot...
    works like a charm...

    (it took a while to reply)

Topic Closed

This topic has been closed to new replies.

About this Topic