Support » Developing with WordPress » wp_list_bookmarks – exclude category

  • Resolved lowrez

    (@lowrez)


    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.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Try the exclude=2 paramter.

    See template tag, wp_list_bookmarks()

    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.

    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.

    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.

    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=

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

    alexo05

    (@alexo05)

    Hmm that didn’t work for me 🙁

    Using WP 2.2.3

    Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    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.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘wp_list_bookmarks – exclude category’ is closed to new replies.