Return to Snippet

Revision: 40618
at February 4, 2011 11:37 by thelukemcdonald


Initial Code
<?php while( $mb->have_fields_and_multi( 'buttons' ) ) : ?>
<?php $mb->the_group_open(); ?>
	<div class="button">
		<?php
		$pages = get_pages();
		$selected = ' selected="selected"';
		$mb->the_field('s_field');
		?>
		<select name="<?php $mb->the_name(); ?>">
		<?php
		foreach ($pages as $pagelist => $page) {
			echo '<option value="'. $page->ID .'"'; $thevalue = $page->ID; if ( $mb->get_the_value() == "$thevalue") echo $selected; echo '>' . $page->post_name .'</option>';
		}
		?> 
		</select>
	</div>
<?php $mb->the_group_close(); ?>
<?php endwhile; ?>

Initial URL


Initial Description


Initial Title
WPAlchemy - Trying to get pages

Initial Tags


Initial Language
PHP