How to get specific sidebar in a single post? (1 post)

  1. armstrong1118
    Posted 8 years ago #

    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:

         if (is_single() && $_SERVER['REFERER'] == "http://www.website.com/wordpress/?cat=16" {
             echo "<ul>";
             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?

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.