WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] wp_list_bookmarks - exclude category (9 posts)

  1. lowrez
    Member
    Posted 6 years ago #

    I have found how to include a single cagetory in my blogroll links, but am unable to exclude a category. The following example results in the display of only 'category 2' category name and links. I want to display all except "category 2'.

    <?php wp_list_bookmarks('categorize=1&category=2&title_li='); ?>

    Using version 2.2.2

    Thanks.

  2. MichaelH
    Member
    Posted 6 years ago #

    Try the exclude=2 paramter.

    See template tag, wp_list_bookmarks()

  3. lowrez
    Member
    Posted 6 years ago #

    I did try the exclude=2, which resulted in a wp error.

    WordPress database error: [Column 'link_id' in where clause is ambiguous]..

    <?php wp_list_bookmarks('categorize=1&exclude=2&title_li='); ?>

    perhaps this is an issue only related to version 2.2.2.

  4. MichaelH
    Member
    Posted 6 years ago #

    My confusing here, there is no exclude category parameter--the exclude works to exclude specific links.

    But could try the category=1,2,3 parameter where you could build a list of the categories you did want displayed.

  5. lowrez
    Member
    Posted 6 years ago #

    Currently, your suggestion seems to be the only solution. This is less than optional because new categories will not automatically display.

    Thanks for your help.

  6. lowrez
    Member
    Posted 6 years ago #

    The magical mystery hack has been discovered. Please note that this is a hack with no guarantee of working in future releases of WP.

    &exclude_categories=

  7. MichaelH
    Member
    Posted 6 years ago #

    Even more magical because I find no reference to exclude_categories in WordPress 2.2.3 or 2.3.

  8. alexo05
    Member
    Posted 6 years ago #

    Hmm that didn't work for me :(

    Using WP 2.2.3

  9. Samuel Wood (Otto)
    Tech Ninja
    Posted 6 years ago #

    Heh. This should work, but I warn you, it's a massive ugly hack. :)

    <?php wp_list_bookmarks( array(
    'categorize' => '1',
    'category' => '&exclude=2',
    'title_li' => '',
    ) ); ?>

    I warned you. But given the current code in 2.3.1, I think it'll do. I make absolutely no guarantees for future revisions.

Topic Closed

This topic has been closed to new replies.

About this Topic