Skip to content

Instantly share code, notes, and snippets.

@kirstenkeister
Created January 19, 2012 19:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save kirstenkeister/1642159 to your computer and use it in GitHub Desktop.
Save kirstenkeister/1642159 to your computer and use it in GitHub Desktop.
WPAlchemy meta definitions for repeating links
<?php
global $peoplelinks_mb;
$peoplelinks_mb->the_meta();
if ($peoplelinks_mb->have_fields('links')) { ?>
<div id="info-links" class="column left">
<h2 class="column-title">Links</h2>
<ul>
<?php // loop a set of field groups
while($peoplelinks_mb->have_fields('links')) {
$url = $peoplelinks_mb->get_the_value('url');
$title = $peoplelinks_mb->get_the_value('title');
echo '<li><a href="' . $url . '" target="_blank" rel="nofollow">';
echo $title . '</a></li>';
} ?>
</ul>
</div>
<?php } ?>
$peoplelinks_mb = new WPAlchemy_MetaBox(array(
'id' => '_people_links',
'title' => 'Links',
'types' => array('people'),
'mode' => WPALCHEMY_MODE_EXTRACT,
'template' => get_stylesheet_directory() . '/metaboxes/people-meta-links.php'
));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment