You must have noticed that my Categories are not listed in a list view on this blog as usual, it is listed in a dropdown view.
drop down view
It is quite easy to achieve this view in your blog.

How to Display Dropdown Select List with Submit Button

Simply copy and paste the code below into where you want the Dropdown Category Select list to dispaly


<li id="categories" style="list-style: none;"><?php _e('Categories:'); ?>
<ul><li style="list-style: none;">
<form action="<?php echo $PHP_SELF ?>" method="get">
<?php dropdown_cats(); ?>
<input type="submit" name="submit" value="view" />
</form>
</li></ul>
</li>

This can be used in the Sidebar, Header, Footer and other PHP files in the wordpress theme, and can also be used in MobilePress

How to Display Dropdown Select List without Submit Button

Firstly Download and install the plugin Drop Down Categories.

Now Add the following code found below into your header.php template file:


<script type="text/JavaScript">
<!-- function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
//-->
</script>

Then add the following code to wherever you’d like the dropdown categories to be displayed (for example, your sidebar.php file):

<form action="">
<select name="menu" onchange="MM_jumpMenu('parent',this,0)">
<option>Choose one</option>
<?php dropdown_cats_exclude('name', 'asc'); ?>
</select>
</form>

It can also be added into MobilePress

Hope this post was helpful.

1 COMMENT

  1. oscar, my credit don finish, please can you please download the file and re activate wordpress on that blog for me? Please, can you enter facebook chat, let’s chat please.

LEAVE A REPLY

Please enter your comment!
Please enter your name here