WordPress.org

Ready to get started?Download WordPress

Forums

hiding categories using wp_list_categoires (13 posts)

  1. marketingfm
    Member
    Posted 5 years ago #

    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) ?>
                <li>&nbsp;</li>
    		</ul>

    Anyone know how to exclude these categories from showing up in WP 2.7? You can see them all displayed here; http://www.marketing.fm

  2. MichaelH
    Member
    Posted 5 years ago #

    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?

    Resource:
    Reporting Bugs

  3. marketingfm
    Member
    Posted 5 years ago #

    Submitted it.
    http://trac.wordpress.org/ticket/8614#comment:1

    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.

  4. fleetadmiralj
    Member
    Posted 5 years ago #

    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)

  5. DaveOOOii
    Member
    Posted 5 years ago #

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

  6. fleetadmiralj
    Member
    Posted 5 years ago #

    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.

  7. DaveOOOii
    Member
    Posted 5 years ago #

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

  8. MichaelH
    Member
    Posted 5 years ago #

    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.

  9. marketingfm
    Member
    Posted 5 years ago #

    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?

  10. MichaelH
    Member
    Posted 5 years ago #

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

  11. navigadget
    Member
    Posted 5 years ago #

    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.

  12. MichaelH
    Member
    Posted 5 years ago #

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

  13. timjamz
    Member
    Posted 5 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Topic