Skip to content

Instantly share code, notes, and snippets.

@richardegil
Created January 31, 2013 22:33
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 richardegil/4687274 to your computer and use it in GitHub Desktop.
Save richardegil/4687274 to your computer and use it in GitHub Desktop.
for chad
/* Display Background URLs */
function sidebar_feature( $post ) {
// Use nonce for verification
wp_nonce_field( plugin_basename( __FILE__ ), 'myplugin_noncename' );
$sidebar_feature = get_post_meta($post->ID, 'sidebar_feature', true);
?>
<select name="sidebar_feature">
<option value="">Select a Feature</option>
<?
$loop = new WP_Query( array ( 'post_type' => 'sidebar-features') );
if ($loop->have_posts()){
while ($loop->have_posts()) {
$loop->the_post();
$do_not_duplicate = $post->ID;
echo '<option value="' . the_ID() . '"';
if(get_the_ID() == $side_ID) {
echo 'selected';
}
echo '>' . the_title() . '</option>';
}
}
wp_reset_query();
?>
</select>
<?php
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment