WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. armstrong1118
    Member
    Posted 6 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:

    <?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?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.