WordPress.org

Ready to get started?Download WordPress

Forums

I need a default category that does not appear as a link. (11 posts)

  1. biodrama
    Member
    Posted 4 years ago #

    I need to prevent my default category from appearing in the list of category links. Is there a way to hide the default category title, but still display all posts when the user clicks the "blog" (show all) tab?

  2. hellomatt
    Member
    Posted 4 years ago #

  3. biodrama
    Member
    Posted 4 years ago #

    My goodness that was quick!

    I'm afraid my question wasn't clear enough. I don't want to hide the default category's posts from the front page. I only want to prevent the default category from appearing in the list of category links. Isn't it true that you must have a default category?

  4. biodrama
    Member
    Posted 4 years ago #

    I found this.

    I guess that means modifying the theme files? Don't really want to do that, other than the CSS.

    Could I delete my default category entirely? Would its posts default to "Uncategorized," or just disappear?

  5. hellomatt
    Member
    Posted 4 years ago #

    You must have a default category but you do not have to show it. I'm not sure about deleting the default category, but if you are able to, the posts would move to another or become "uncategorized".

    There is a way to remove a certain category from a list of all of them, but i am not sure if that's what you mean. Could you please clarify?

    Can you provide a link to your site? On the page, where are the categories you mention, and which one do you want removed?

    Also, perhaps you could paste your index.php file as well. Be sure to put it in between backticks.

  6. MichaelH
    Member
    Posted 4 years ago #

    The http://faq.wordpress.net stuff is pretty old and you will get better information at http://codex.wordpress.org or http://codex.wordpress.org/FAQ

    With the help of the Template Hierarchy article, determine what Template is displaying the Categories (probably sidebar.php.

    Then look for something like wp_list_categories() and add the exclude=x where x is the category id of your uncategorized category.

    Note: this plugin http://wordpress.org/extend/plugins/reveal-ids-for-wp-admin-25/ helps determine IDs for posts/categories etc.

  7. Edward Caissie
    Theme Review Admin
    Posted 4 years ago #

    You can use a little CSS added to the end of your style.css file to stop a category title from appearing in the list, in your example, the "Uncategorized" default category can be made to not show up with:

    .cat-item-1 {display:none;}

    If you want to use a different default category, finds its ID and replace the "1" above accordingly.

    (NB: I tested this and had to refresh a couple of times using the default theme on my test server but it will work.)

  8. biodrama
    Member
    Posted 4 years ago #

    Thanks to everyone who posted with helpful info and inquiries. I got distracted by a bunch of work on another project, and just made it back here tonight. The blog is Here, and I think Portfolio is the default category. My friend who has the wood shop doesn't want "Portfolio" to appear in the Category links at right.

  9. biodrama
    Member
    Posted 4 years ago #

    cais,

    I used your method, and it worked fine. Nice & simple.

  10. cokeefe
    Member
    Posted 4 years ago #

    THANKS FOR THE "EXCLUDE=1"

    hA!!! I'm going to have to delete my whole word press now because of it.

    So much for freeware

  11. cjackson23
    Member
    Posted 4 years ago #

    cais, your css fix works great. So simple. Thank you very much.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags