1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Hiding a categorie ?

Discussion in 'WordPress' started by KaytoKid, Feb 24, 2010.

  1. #1
    hi guys ,

    I am new to the wordpress section , this is my first post here and I wish you help me out.

    I have a WP blog , the problem is that there is one particular categorie that I don't want it to be seen , I want to hide it. Here is the part of my Sidebar code that needs to be modified :

    <div id="sub-sidebar">
    <div class="left">
    <ul><?php wp_list_categories('hide_empty=0&show_count=0&title_li=<h2>' . __('Categories', 'kubrick') . '</h2>'); ?></ul>
    <?php dynamic_sidebar('sidebar_left');?>
    </div>
    Code (markup):
    The category that I want to hide is cat_ID=28.
    So please help guys , I've tried all kinds of plugins but nothing seem to be working.
    Thank you very much in advance
     
    KaytoKid, Feb 24, 2010 IP
  2. s_ruben

    s_ruben Active Member

    Messages:
    735
    Likes Received:
    26
    Best Answers:
    1
    Trophy Points:
    78
    #2
    Try this code:

    
    <div id="sub-sidebar">
    <div class="left">
    <ul><?php wp_list_categories('exclude=28&hide_empty=0&show_count=0&title_li=<h2>' . __('Categories', 'kubrick') . '</h2>'); ?></ul>
    <?php dynamic_sidebar('sidebar_left');?>
    </div>
    
    Code (markup):
     
    s_ruben, Feb 24, 2010 IP
  3. KaytoKid

    KaytoKid Peon

    Messages:
    40
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thank you very very much , that worked like charm
     
    KaytoKid, Feb 24, 2010 IP
  4. Jalpari

    Jalpari Notable Member

    Messages:
    5,640
    Likes Received:
    137
    Best Answers:
    0
    Trophy Points:
    260
    #4
    wp category exclude rule:
    exclude=28 u can enter more cat ID for hiding them.

    wp category include rule

    replace 28,26,27 with your categories no.
     
    Jalpari, Feb 25, 2010 IP
  5. unknownpray

    unknownpray Active Member

    Messages:
    3,831
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    70
    #5
    use this code <ul><?php wp_list_categories('include=28,26,27&hide_empty=0&show_count=0&title_li=<h2>' . __('Categories', 'kubrick') . '</h2>'); ?></ul> to hide category or simply use category plug in :)
     
    unknownpray, Mar 16, 2010 IP