analyze custom key value
-
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:
<?php
$var = get_post_meta($post->ID, 'imageurl', true);
if ($var !== 'jpg')
{
echo "<p>I'm the default text!</p>";
} else {
echo "hallo:" . $var . "image";
} ?>
- The topic ‘analyze custom key value’ is closed to new replies.