Support » Fixing WordPress » Removing some catagories from the fromtpage

  • Resolved jthusgaard



    I need to remove 2 catagories from the frontpage of my site ( I have sucessfully removed one catagory from the frontpage and need to remove one more. How do I do that?

    So far I have used: <?php
    if ((empty($_GET[‘cat’]))&&(!preg_match(‘/wp-admin/’, $_SERVER[‘REQUEST_URI’]))) $cat = ‘-1’;

    Adding another cat number to the list does not help, så how do I do this when I want to remove cat 1 & 5 from my frontpage?


Viewing 6 replies - 1 through 6 (of 6 total)
  • Depends what Template Tag you are using to call the category list.

    If you’re using wp_list_cats you’d do something like this:

    <?php wp_list_cats('sort_column=name&optioncount=1&exclude=10, 15'); ?>

    where the numbers in “exclude=10,15” are the numerical categories you want to exclude.

    How do I know what template tags I’m using to call the catagory list?

    I want the catagories to be listet (in the colum on the left) but just not to have them listed in the field where the pages go.


    If I understand what you’re trying to say, you wish to exclude posts that belong to either one of the two specified category (and not exclude the display of the category links as Tom inferred).

    If that is the case, then unfortunately the short answer is that you can’t due to the way the underlying SQL used for excluding/including categories was written in WP. To do the same, you’ll either have to
    a) use a single category (i.e. called exclude) and attach posts from both categories to it
    b) or carry out the effect of excluding multiple categories by including every other category but those two i.e. $cat = ‘2,3,4,6’;

    How do I go about doing any of the two solutions that you suggest!

    How come I can not use the hack I’m already using, in an extended version, It only works on one catagory:

    if ((empty($_GET[‘cat’]))&&(!preg_match(‘/wp-admin/’, $_SERVER[‘REQUEST_URI’]))) $cat = ‘-1’;


    I use a plugin called category-levels from I think it should do what you want.

    I’m using the catagory visibility plugin, that can be found here:

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Removing some catagories from the fromtpage’ is closed to new replies.