Trying to wp_get_archives to display the post ID in a <select> box!
-
So… I am creating my own WP theme, which includes an admin page that I custom developed myself to manage the theme. I am having an issue with trying to use a <select> box to choose the “Feature” post on the site. I am using the following code to grab the last 50 site posts and display them in a <select> box:
<select name="choose-post-dropdown"> <option value=""><?php echo attribute_escape(__('Select a Post (Try to be more recent)')); ?></option> <?php wp_get_archives('type=postbypost&format=option&show_post_count=0&limit=50'); ?> </select>
You can see these images to get an idea of what the code does for my admin page: Here and Here
So, now I want, when I chose a post, the <select> box to update it’s value with the selected posts ID… because ultimately I am going to be grabbing the value like this:
<input type="hidden" name="page_options" value="dd_mainfeature_post_id," />
And then displaying in my theme like this…
<?php echo get_option("dd_mainfeature_post_id"); ?>
Can anyone help with my problem??
thanks
- The topic ‘Trying to wp_get_archives to display the post ID in a <select> box!’ is closed to new replies.