Dynamic Content in Sidebar (5 posts)

  1. masonchumpia
    Posted 11 years ago #

    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?

  2. Kafkaesqui

    Posted 11 years ago #

    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:

  3. aaronws
    Posted 11 years ago #

    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.

  4. moshu
    Posted 11 years ago #

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

  5. mush
    Posted 10 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.