Created
January 31, 2013 22:33
-
-
Save richardegil/4687274 to your computer and use it in GitHub Desktop.
for chad
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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