using wp_list_bookmarks on single.php pages (3 posts)

  1. kayjayone
    Posted 7 years ago #

    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?

  2. 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".

  3. kayjayone
    Posted 7 years ago #

    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")) {

Topic Closed

This topic has been closed to new replies.

About this Topic