• Resolved atelier455

    (@atelier455)


    I’m using the Sidebar Widgets plugin on my blog, but I’d like to display different sidebar content on the *pages* on the site. I think the easiest way to do this is to amend the sidebar.php file with some if statements…but I’ve not been able to work out the exact way of doing this.

    Here’s the current code in my sidebar.php file:

    <div id=”sidebar”>

      <?php if ( !function_exists(‘dynamic_sidebar’)
      || !dynamic_sidebar() ) : ?>

      <li><h2>About us</h2>
      <p>About text will go here</p>
      </li>
      <?php endif; ?>

    </div>

    Can anyone advise how this should be amended so that pages don’t use Sidebar Widgets, but rather use the sidebar content between the

    • tags above?

      Any help would be hugely appreciated!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    www.remarpro.com Admin

    Change:

    <?php if ( !function_exists('dynamic_sidebar')
    || !dynamic_sidebar() ) : ?>

    To:

    <?php if ( is_page() || !function_exists('dynamic_sidebar')
    || !dynamic_sidebar() ) : ?>

    Thread Starter atelier455

    (@atelier455)

    Thank you – I knew it would be simple but it had completely defeated me. It’s working just the way I want it to now.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Exclude Sidebar Widgets from pages’ is closed to new replies.