Black Webmasters Forum

 


Reply
  #1  
Old 04-11-2011, 02:28 PM
Administrator
 
Join Date: Aug 2010
Posts: 85
Thanks: 7
Thanked 21 Times in 20 Posts
Default Block category from sidebar drop down list

If you are trying to stop a category from showing in your sidebar's drop down this will do the trick.

First down and install the php code widget

This will add a new widget to your list called PHP Code.

Drag the php code widget to the sidebar and past this code inside:

Code:
<form action="<?php bloginfo('url'); ?>/" method="get">
<?php
$select = wp_dropdown_categories('show_option_none=Select category&show_count=1&orderby=name&exclude=XX&echo=0');
$select = preg_replace("#<select([^>]*)>#", "<select$1 onchange='return this.form.submit()'>", $select); echo $select; ?>
<noscript><input type="submit" value="View" /></noscript>
</form>
Replace the XX with the category number and save. To exclude more than one category, use a comma to separate them (&exclude=XX,XX,XX)
__________________
Follow Me On Twitter
Reply With Quote
The Following User Says Thank You to Pockets For This Useful Post:
enarensthel (04-28-2012)
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


 
Our Sponsor Links

Help Us Grow


Follow Black Webmasters on Twitter
Black Webmasters on Twitter



Link to us:
Black Webmasters Forum
Please link to: http://www.blackwebmasters.com



Premium Wordpress Themes
Premium Wordpress Themes



Content Relevant URLs by vBSEO 3.6.0