Support » Fixing WordPress » How to get specific sidebar in a single post?

  • I just finished figuring out how to have a specific sidebar in a single post based on the referring page.

    My question is, might there be a cleaner or more efficient way of doing it?

    Currently in my sidebar.php:

    <?php
         if (is_single() && $_SERVER['REFERER'] == "http://www.website.com/wordpress/?cat=16" {
             echo "<ul>";
             wp_list_bookmarks(stuff);
             echo "</ul>;
         }
    ?>

    I would rather not have to list lie 20 or so if the if and else if statements in the sidebar.php

    Any suggestions?

  • The topic ‘How to get specific sidebar in a single post?’ is closed to new replies.