im trying to do a simple if function on my code but for some reason it just isnt working correctly, ive gone over it several times to see if there is anything im missing but no luck, im trying to say my value is 0 then echo nothing if not else the_ratings. very simple...
<?php if( get_post_meta( $post_id, 'ratings_users', true ) === '0' ) {
}else{
the_ratings();
} ?>
<?php if(!get_post_meta( $post_id, 'ratings_users', true ) !='0' ) {
}else{
the_ratings();
} ?>
<?php if(get_post_meta( $post_id, 'ratings_users', true ) =='0' ) {
}else{
the_ratings();
} ?>
edit: at this point ive tried 3 different ways to get this stupid thing to output nothing if the value in the custom field is 0 and still it doesnt work correctly
true/falsecomparison, a$value = '0'string comparison, or anisset()comparison. My assumption is that you're actually trying to determine if particular post meta is set before outputting it, but it is difficult to tell for sure. – Chip Bennett Aug 16 '11 at 14:10