Support » Plugins » using wp_list_bookmarks on single.php pages

  • I’ve implemented custom single.php pages (single-10.php for example) and I’m trying to pull links based on the same category using the following…

    <?php wp_list_bookmarks('categorize=0&category=10&title_li'); ?>

    While this works on other pages it does not on the custom single pages, no links are displayed. Does the wp_list_bookmarks work on single.php pages?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Samuel Wood (Otto)

    (@otto42) Admin

    Obvious question: Are there any links in category 10?

    And yes, wp_list_bookmarks can be used anywhere in the theme.

    Also, “single-10”? How are you referencing/loading this file? WordPress does not load/use single-anything. Just “single.php”.

    Hi Otto42

    There are links in category 10 and they are displaying correctly on another page.

    Calling single-10.php from single.php using the following code…

    $category = get_the_category();
    $currentcat = $category[0]->cat_ID;
    if (file_exists(TEMPLATEPATH."/single-$currentcat".".php")) {
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘using wp_list_bookmarks on single.php pages’ is closed to new replies.