Forums

[resolved] category_name parameter not working in wp_list_bookmarks? (5 posts)

  1. klunko
    Member
    Posted 5 years ago #

    I just upgraded to 2.1 and, like others here, I'm having trouble with the new wp_list_bookmarks replacement for wp_get_linksbyname. What I need to is retrieve a list of bookmarks using a category name (NOT integer). The codex for wp_list_bookmarks mentions a parameter called category_name that should be able to do this. So far I've been unable to get this work at all. I've tried:

    wp_list_bookmarks('category_name=name')

    and

    $catname='name';
    wp_list_bookmarks('category_name=$catname')

    Is it simply not functioning?

  2. Otto
    Tech Ninja
    Posted 5 years ago #

    No, it's not you. The category_name parameter does not work at this time. I think it's there for future reference, when certain other upgrades go into place.

    The only way to limit categories is with the "category" parameter, which takes a numeric input.

  3. klunko
    Member
    Posted 5 years ago #

    Thanks Otto. So is there really no way to get links by category name right now? Seems weird that WordPress would put out a new version without that basic functionality...

  4. Otto
    Tech Ninja
    Posted 5 years ago #

    You could call get_cat_ID('Name') to get the category ID, and then call it with that ID. At the moment, that's the best available.

  5. klunko
    Member
    Posted 5 years ago #

    Thanks, that helps.

Topic Closed

This topic has been closed to new replies.

About this Topic