If custom field else

How to check for a custom field and do something:


<?php
$number = get_post_meta($post->ID, 'number', true);
if ( $number ) {
echo 'there is a custom field value';
}
else {
echo 'no custom field value';
}
?>

Revisions

There are no revisions for this post.

Tags: , ,

No comments yet.

Leave a Reply