Support » Fixing WordPress » hiding categories using wp_list_categoires

  • I recently upgraded to WordPress 2.7 and trying to use the wp_list_categories function to hide categories. In fact it was working fine before 2.7 and now they are showing up – no code changes were made by me.

    Below is the code

    <ul id="nav" class="grid_13">
    			<?php include(TEMPLATEPATH . '/includes/version.php'); ?>
    			<?php wp_list_categories('title_li=&exclude=3,4,5,8,9,10,11,12,15,17,18,20,21,24,25,26,27,28,29,30,31,32,33,34,35,37,38,39,40,43,44,45,47,48,49,50,52,53,55,57,58,1,61,62,64,65,66,67,68' . $ex_aside) ?>

    Anyone know how to exclude these categories from showing up in WP 2.7? You can see them all displayed here;

Viewing 12 replies - 1 through 12 (of 12 total)
  • Yeah I can duplicate that. Interestingly include=3 will just print category=3 but exclude=3 prints all categories.

    You want to report that to Trac and reference this thread?

    Reporting Bugs

    Submitted it.

    Never done one of these before so I apologize if I left something out. I assume it makes sense to have this in 2.8? Anyway, appreciate helping this move forward.

    Ah, darn, I should have seen this before posting my own support post. For me, it appears to be excluding the specific categories that I list, but NOT the children of those categories (which is what matters to me as the parents are for organizational purposes only)

    Is there a workaround for this excluding problem? Or does anyone know if or when there will be a fix in wordpress? Thanks.

    DaveOOOii – I don’t know about anyone else, but excluding a category does indeed exclude that category, but none of that category’s children. So my workaround for now was just adding all of the children category from the exclude list (a pain), but that seems to work, at least for me.

    Thanks. Thats what I did and it mostly works and it is most definitely a pain hopefully this will get fixed eventually.

    Amending previous statement (don’t know what I thought I was testing) and agreeing with fleetadmiralj that it is excluding the parent category but not the children of that category.

    I know agree as well that you now have to exclude the children categories individually. Prior code allowed all “children” categories to be hidden by default, but now you must explicitly hide them with the exclude code.

    Not sure this is the best system, but it has fixed the header problem I was experiencing prior.

    Perhaps MichaelH – you can update the Trac thread to reflect this?

    Thanks marketingfm–updated that ticket (8614) in Trac and revised the summary (title) to reflect the acknowledged problem.

    Hi all,

    I do have the same bug. Looks like there’s some activity on that Trac site. It says ‘has-patch’.

    Can you explain how to make use of that diff file to patch my site? I’m not familiar with the “Trac” thing. I can only ftp to my site. No shell. Will I have to add the greens, remove the reds manually, then FTP?

    Thank you.

    You would have to manually do the edit(s) or use SVN to apply the patch.

    Thanks, MichaelH. You WP mods are the bees knees! ^5

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘hiding categories using wp_list_categoires’ is closed to new replies.