• 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?

Viewing 10 replies - 1 through 10 (of 10 total)
  • Thread Starter biodrama

    (@biodrama)

    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?

    Thread Starter biodrama

    (@biodrama)

    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?

    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.

    The https://faq.wordpress.net stuff is pretty old and you will get better information at https://codex.www.ads-software.com or https://codex.www.ads-software.com/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 https://www.ads-software.com/extend/plugins/reveal-ids-for-wp-admin-25/ helps determine IDs for posts/categories etc.

    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.)

    Thread Starter biodrama

    (@biodrama)

    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.

    Thread Starter biodrama

    (@biodrama)

    cais,

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

    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

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

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘I need a default category that does not appear as a link.’ is closed to new replies.