analyze custom key value (1 post)

  1. to_ul
    Posted 7 years ago #

    hello wp-community!
    is there a way to analyze the value of a custom field?
    for example: if my custom field contains a gif-image and not a jpg i wanna post a message and hide the custom field.

    following does not work:

    $var = get_post_meta($post->ID, 'imageurl', true);
    if ($var !== 'jpg')
    echo "<p>I'm the default text!</p>";
    } else {
    echo "hallo:" . $var . "image";
    } ?>

Topic Closed

This topic has been closed to new replies.

About this Topic