• Hi,

    Does anybody know how I go about excluding specific categories from the widget drop-down menu that I put on my site’s sidebar? I want certain categories to not appear on that list. I can’t figure out how to do it. All the directions I found online are for older versions of WordPress and I couldn’t get them to work.

    Do I have to do this through FTP? Or can I do this by modifying the PHP of my template on WordPress itself?

    While we are on the subject, I also want to exclude certain categories from the “Posted In” footer at the bottom of each post. I know what section of code I need to modify in order to do this (in the loop.php file), but I don’t know exactly how to go about doing so.

    (I am a bit of a n00b at this, so I apologize if these are really simple problems).

Viewing 9 replies - 1 through 9 (of 9 total)
  • Does anybody know how I go about excluding specific categories from the widget drop-down menu that I put on my site’s sidebar?

    There isn’t an option to exclude any categories when using the default Categories widget in Appearance->Widgets. You might be better off using wp_list_categories instead.

    Thread Starter ryanandrewsimmons

    (@ryanandrewsimmons)

    I should have been more clear. I understand I can’t do it through the default options. That’s why I asked,

    “Do I have to do this through FTP? Or can I do this by modifying the PHP of my template on WordPress itself?”

    I read that page, and I understand the code, I just don’t understand WHERE I go to make these changes. So the code I want is,

      <?php wp_list_categories(‘orderby=name&include=3,5,9,16’); ?>

    Where do I put this? I looked through all of the Template Tag instructions but they are very vague about this point.

    o I have to do this through FTP? Or can I do this by modifying the PHP of my template on WordPress itself?

    You can either modify the relevant theme template file via Appearance->Editor. Or download it using FTP & modify it in a plain text editor. The latter is probably safer.

    Where do I put this?

    There’s no way to answer that than to say – wherever you want this list of categories to appear.

    Thread Starter ryanandrewsimmons

    (@ryanandrewsimmons)

    I want to put it on the sidebar, like the widget.

    Which .php file do I need to edit? Theme.php? Loop.php? More than one?

    Do you know what part of the code relates to the sidebar specifically?

    Sorry to keep badgering you, but again, I’m new.

    sidebar.php?

    Hi, you can use a php-widget plugin, that will enable you to put php code in a sidebar widget that will list your categories.You can try this widget plugin.

    Thread Starter ryanandrewsimmons

    (@ryanandrewsimmons)

    Thanks, esmi. Your solution worked perfectly!

    Hi, i’d like to do the same (exclude a category from the default dropdown category widget).

    As far as i see, i gotta modify sidebar.php

    But what excactly should i add (code)? And where?

    And if i modify that file then all blogs in network will be modified?

    @linkfr

    per forum rules, please start your own topic

    if you are using ‘multisite’, please start a topic in http://wordpress.org/support/forum/multisite#postform

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Exclude categories from widget drop-down menu’ is closed to new replies.