Support » Fixing WordPress » Using the wp_list_bookmarks call

  • I have had my blogroll called up individually due to design considerations. (css styling of the bookmark header)

    Previous to ver 2.0 that was easy. Since the move 2.0 (2.1.2 specifically) and the use of the tag wp_list_bookmarks I have not been able to get them to display properly.

    Based on the codex this tag with the arguements should only display the bookmark I desire (3) and no others.

    <?php wp_list_bookmarks('exclude=1,2,4,5'); ?>

    However that has not been the case and it displays all 5 categories of bookmarks.

    So, have I misinterpreted what the tag should be or is the problem related to something else.

Viewing 6 replies - 1 through 6 (of 6 total)
  • I’ll add this as a way to bump.

    When trouble shooting this I cleared the cache in both the browser and the wp-cache plugin.

    Still no response?

    3 days and counting.

    At one time this forum was pretty responsive to help requests. I guess not so much any more.

    I think there is a problem with this function and some of its parameters.
    Have you tried with ‘category’ or ‘include’?

    I had this same problem. Basically, wp_list_bookmarks was just ignoring the exclude parameter and I couldn’t get any other function to work the way I wanted either. It was a simple fix though, hopefully someone from WP will see this and incorporate into the code. If you go into the wp-includes/bookmark-template.php file the following two items will fix this:

    1) On line 323, add a default for exclude value of an empty string
    2) On line 331, pass the exclude value to the get_categories function (&exclude=$exclude)

    That fixed it for me. It may not fix it in all cases, but it did work for me.

    chewblocka: I suppose a core change would be one way to do it, however a better way would be something more along these lines:

    <?php wp_list_bookmarks('category=3'); ?>

    You don’t have to “exclude” all the other categories when you can just specify them directly.

    BTW, future versions of WordPress do have a fix for this that allows include and exclude to work properly, although they do it in a different way, as include and exclude are used to include or exclude individual bookmarks by their ID number. So I would not recommend leaving your fix in for future use, because it will change. In fact, this is what the original poster was talking about, including or excluding individual links, not whole categories like you are suggesting.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Using the wp_list_bookmarks call’ is closed to new replies.