Try this :
<select name=\”archive-dropdown\” onChange=’document.location.href=this.options[this.selectedIndex].value;’>
<option value=\”\”><?php echo attribute_escape(__(‘Select Post’)); ?></option>
<?php wp_get_archives(‘type=postbypost&format=option&show_post_count=0’); ?> </select>
I hope this helps 🙂
That works thanks! is there anyway i can change that to show the post title instead of the date?
Thanks again
I’ve edited the above code.
When you use postbypost it shows the title instead of date 😀
it works!, Cheers for that, much appreciated!
Just one more thing,
I have another dropdown with the following code:
<?php wp_dropdown_categories(‘show_option_none=Select a Category&show_count=1’); ?>
<script type=”text/javascript”><!–
var dropdown = document.getElementById(“cat”);
function onCatChange() {
if ( dropdown.options[dropdown.selectedIndex].value > 0 ) {
location.href = “<?php echo get_option(‘home’);
?>/?cat=”+dropdown.options[dropdown.selectedIndex].value;
}
}
dropdown.onchange = onCatChange;
–></script>
it displays categories with posts within it, is there some way i can manipulate that to show all the categories even if they don’t have a post within it?
Thanks for this, you are saving me a lot of headache!
Edit:
You should use hide_empty=0
<?php wp_dropdown_categories(‘show_option_none=Select a Category&show_count=1&hide_empty=0’); ?>
brilliant, thanks for your help :o)
No problem. Glad you could use it 🙂
sorry, just ONE more last thing i promise!
the dropdown code you have just listed is fine… i just need it now to show the “uncategorised” category…
Is this possible?
Thanks again
Well the code i gave you above should list all categories you have. But given that the uncategorised category is there in default you might have to delete it and create your own uncategorised category.
OK, thanks for your help, i’ll leave you alone now.
hi, i read the posts. but i could not understand. there are lots of php codes here. 🙁
For example, there are 2 categories that named “A” and “B”. when you login the A category, i want dropdown plugin to show the post of “A” category. when you click the category “B”, i want to dropdown to show the post of category “B is that possible?
plz help
sorry?
`<?php wp_dropdown_categories(‘show_option_none=Select a Category&show_count=1’); ?>
<script type=”text/javascript”><!–
var dropdown = document.getElementById(“cat”);
function onCatChange() {
if ( dropdown.options[dropdown.selectedIndex].value > 0 ) {
location.href = “<?php echo get_option(‘home’);
?>/?cat=”+dropdown.options[dropdown.selectedIndex].value;
}
}
dropdown.onchange = onCatChange;
–></script>`
is that code is workin?
What if I just wanted to display all posts under one specific category (i.e. hacks).
Thank you