get_post_meta – why won’t you work :(
-
Hi all, can anyone help? I’m trying to use the custom post meta in different (read:dirty evil hack) ways.
Using the code below, I always get a T_IS_EQUAL error, if i change it to: != null, I get T_IS_NOT_EQUAL.
The code is deffinately in the WP Loop. I need the code to work even if the Custom Meta Variable isn’t set. (Hence the == Null)
<?php
if (get_post_meta($post->ID, keyValue, true)) == null {
*** do this code ***
} else {
$imageName = get_post_meta($post->ID, keyValue, true);
*** use above variable in this code ***
} ?>
Viewing 11 replies - 1 through 11 (of 11 total)
Viewing 11 replies - 1 through 11 (of 11 total)
- The topic ‘get_post_meta – why won’t you work :(’ is closed to new replies.