[Plugin: Custom Fields Creator] Hide if empty
-
<?php $Status = get_post_meta($post->ID, "Status", true); ?> <?php foreach($Status as $Status) { echo $Status ['status']; } ?>
That is the code I’m using. It works fine except for posts that do not have the newly created field added, I get this error on the posts:
Warning: Invalid argument supplied for foreach() in /***/archive.php on line 32What am I doing wrong and how would I fix it?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘[Plugin: Custom Fields Creator] Hide if empty’ is closed to new replies.