Skip to content

Instantly share code, notes, and snippets.

Created November 8, 2010 13:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/667689 to your computer and use it in GitHub Desktop.
Save anonymous/667689 to your computer and use it in GitHub Desktop.
// This is what I have to output data from a metabox:
<?php $secondaryContentmb = get_post_meta($post->ID,'_secondary_content',TRUE); ?>
<h3><?php echo $secondaryContentmb['title'];?></h3>
<?php echo $secondaryContentmb['description'];?>
// This is what I'm attempting to do but keep getting a fatal error:
<?php if ($secondaryContentmb->have_fields('description')) : ?>
<?php $secondaryContentmb = get_post_meta($post->ID,'_secondary_content',TRUE); ?>
<h3><?php echo $secondaryContentmb['title'];?></h3>
<?php echo $secondaryContentmb['description'];?>
<?php endif; ?>
// I've tried while instead of if but no win.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment