• I have been trying to write code to show a particilar link category on the sidebar of a particular page.

    I’ve tried a few things and nothing seems to work

    I tried things with is_page

    Any suggestions?

    I have a page named ‘Articles’
    I want only link category ‘4’ to appear.

    have a look at the site.

    http://antonyloewenstein.com/
    Thank You in advance.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter 12thharmonic

    (@12thharmonic)

    <div id=”sb-links”>
    <?php
    // let’s generate info appropriate to the page being displayed
    if (is_home()) {
    // we’re on the home page, so let’s show a list of all top-level categories
    echo ”

      “;
      wp_list_cats(‘optionall=0&sort_column=name&list=1&children=0’);
      echo “

    “;
    } elseif (is_category()) {
    // we’re looking at a single category view, so let’s show _all_ the categories
    echo ”

      “;
      wp_list_cats(‘optionall=1&sort_column=name&list=1&children=1&hierarchical=1’);
      echo “

    “;
    } elseif (is_single()) {
    // we’re looking at a single page, so let’s not show anything in the sidebar
    } elseif (is_page()) {
    // we’re looking at a static page. Which one?
    if (is_page(‘articles’)) {
    // our about page.
    echo “articles”;
    } elseif (is_page(’15’)) {
    echo “Books”;
    } else {
    // catch-all for other pages
    echo “All Other Pages”;
    }
    } else {
    // catch-all for everything else (archives, searches, 404s, etc)
    echo “All Else”;
    } // That’s all, folks!
    ?>

    ———————————————————
    Here’s the code from the codex. slightly modified. I put it in. The main page and Archive hooks work, Not The specific Page ID’s… Any Ideas?

    Thread Starter 12thharmonic

    (@12thharmonic)

    K I got it myself. Same code. different placement and it worked perfectly.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘page specific links’ is closed to new replies.