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.

wordpress - Hide categories and post

Discussion in 'WordPress' started by onlinebisnes, Mar 19, 2008.

  1. #1
    Hi,
    Does anyone know how to hide certain categories and all their post at wordpress?
    Is there any plugins that can do that? which we can select which categories(and all post on it) that we want to be visible at our blog.
    Thanks
     
    onlinebisnes, Mar 19, 2008 IP
  2. fish

    fish Well-Known Member

    Messages:
    450
    Likes Received:
    36
    Best Answers:
    0
    Trophy Points:
    120
    #2
    Pretty easy to do by adding arguments to the wp_list_categories(); function.

    http://codex.wordpress.org/Template_Tags/wp_list_categories

    You'd have to add this:

    <?php wp_list_categories('title_li=&exclude=9,10'); ?>
    PHP:
    With 9 and 10 being the category ID numbers you want to exclude. Of course if you don't have the title_li= already in your code just do something like this:

    <?php wp_list_categories('exclude=9,10'); ?>
    PHP:
    Just wanted to demonstrate how to use the & for multiple arguments.

    To hide the posts you'd probably have to do a custom query.

    http://codex.wordpress.org/Template_Tags/query_posts

    Add this before your loop starts:

    <?php query_posts("cat=-9,-10"); ?>
    PHP:
    With 9 and 10 being categories you want to exclude.
     
    fish, Mar 19, 2008 IP
    tonyran likes this.
  3. just-4-teens

    just-4-teens Peon

    Messages:
    3,967
    Likes Received:
    168
    Best Answers:
    0
    Trophy Points:
    0
    #3
    any posts that you want hidden can be password protected, as for the categories use the suggestion above.
     
    just-4-teens, Mar 19, 2008 IP
  4. onlinebisnes

    onlinebisnes Peon

    Messages:
    829
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    thanks guys,
    but I had more than 200 categories..I wanted to find an easy way such as a plugin that list all the cat and we can just tick which cat that we want to visible/hidden.
    anyone?
     
    onlinebisnes, Mar 19, 2008 IP
  5. fish

    fish Well-Known Member

    Messages:
    450
    Likes Received:
    36
    Best Answers:
    0
    Trophy Points:
    120
    #5
    Actually I just found this plugin. It may work better for you and wouldn't require any template file edits.

    Category Visibility Plugin - http://www.ryowebsite.com/?p=46

    It says it can hide posts in those categories too. Never used it myself so I can't personally vouch for it...good luck.
     
    fish, Mar 19, 2008 IP
  6. onlinebisnes

    onlinebisnes Peon

    Messages:
    829
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    thanks for the link, fish
    I try to look into it first..btw there is new updated page for that plugin : http://www.ipeat.com/?page_id=91
    will test it with my site soon.
    thanks
     
    onlinebisnes, Mar 19, 2008 IP
  7. onlinebisnes

    onlinebisnes Peon

    Messages:
    829
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    seem like the lugin has a bug..all the function is there..but when I try to uncheck the visibility of one category it keep on returned to default state when I update the setting.
    And when I try to view my page all the categories and post are gone..got this error msg : "Sorry the post you looking for had been deleted"
    I think have to wait for next update..
     
    onlinebisnes, Mar 19, 2008 IP