OscarminiOscarmini
  • Home
  • Reviews
  • Computers
  • How Tos
  • Travel & Lifestyle
  • Phone ROMs
  • Contact
    • Advertise
    • About Us
Facebook Twitter Instagram
  • Advertise With Us
  • Newsletter
Facebook Twitter Instagram
Oscarmini Oscarmini
  • Home
  • Reviews
  • Computers
  • How Tos
  • Travel & Lifestyle
  • Phone ROMs
  • Contact
    • Advertise
    • About Us
OscarminiOscarmini
Home»Blogging»Adding a Dropdown Category List View to WordPress Blog
Blogging

Adding a Dropdown Category List View to WordPress Blog

Oscar FrankBy Oscar Frank2 Mins Read
Share
Facebook Twitter LinkedIn WhatsApp Pinterest Email

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

  • Mobilize your WordPress blog with Mobilepress
  • HOW TO INSERT ADSENSE, INMOBI AND OTHER ADS INTO MOBILEPRESS
  • HOW TO CUSTOMIZE MOBILEPRESS CSS
  • HOW TO ADD EXCERPTS AND THUMBNAIL TO 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.

Get the most important happenings in your inbox weekly

blogging Coding HTML Javascript webdesign Wordpress

Related Posts

Navigating Coding Difficulties; What To Do When You Hit A Snag

February 11, 2022

Common Mistakes Newbie Developers Make and Solutions

March 23, 2021

5 Best Gadgets For Hobby-Bloggers In 2023

March 3, 2021
View 1 Comment

1 Comment

  1. omosco on October 23, 2012 1:31 am

    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.

    Reply

Leave A Reply Cancel Reply

Latest Posts

Curacel, a Nigerian Insurtech Startup, Raises $3 Million

February 17, 2023

Google Redesigns and Upgrades Gboard Toolbar

February 16, 2023

Internet Explorer to be Permanently Disabled

February 16, 2023

iPhone 15 Pro to Feature Thinner Bezels

February 16, 2023
Get the best African tech newsletters in your inbox
Oscarmini
Facebook Twitter Instagram YouTube
© 2023 Oscarmini Co. Designed by illBytes.

Type above and press Enter to search. Press Esc to cancel.