WordPress.org

Support

Support » Themes and Templates » Dynamic Content in Sidebar

Dynamic Content in Sidebar

  • There are some arguments in the 1.5 Default theme that provide a pretty solid way of displaying dynamic content. For example, from sidebar.php of the Default theme:

    <?php /* If this is a category archive */ if (is_category()) { ?>

    Any content following that tag will only be displayed if the user is viewing entries organized by category. Is there any way to provide an argument where content can be displayed in the sidebar if and only if the user is viewing comments for an entry?

Viewing 4 replies - 1 through 4 (of 4 total)
  • is_single() will verify if you’re viewing a single post page, but since the default theme doesn’t use the sidebar when on an individual post, it would need to be tested in another template (like say single.php).

    If you *want* the sidebar on single posts, you could use my mod of the default theme:
    http://wordpress.org/support/topic.php?id=25616

    Are there any constants that can be used to test for certain pages? E.g.

    if page == my_resume then
    create resume menu
    else if page == my_gallery then
    create gallery menu

    I would like to change the sidebar contents with every page.

    I think Kaf gave me some excellent solutions here for a similar request of mine – see the code with the page_id.

    How can I suppress sidebar content on single page posts? (Not all of it, but certain elements.)

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Dynamic Content in Sidebar’ is closed to new replies.