WordPress.org

Forums

Terrifico
Sidebar only on blog not pages (4 posts)

  1. Myebra
    Member
    Posted 1 year ago #

    Hello!
    Thank you for the theme, it's fantastic.
    I was wondering how I can get the sidebar to display only on posts and not post pages? I tried modifying the page php template but didn't have much luck...
    Thanks!!
    Cheers,
    Maria

  2. ademos
    Member
    Posted 1 year ago #

    Hello.

    You can use a conditional tag called "is_single" to only display your sidebar content on WordPress posts, but not on WordPress pages.

    Add the following to your sidebar.php file.

    <?php if (is_single() ) { ?>
    <!-- Replace this comment with your sidebar content. -->
    <?php } ?>

    You can learn more about the "is_single" conditional tag here: http://codex.wordpress.org/Function_Reference/is_single

  3. Myebra
    Member
    Posted 1 year ago #

    Thanks!! It worked!

  4. ademos
    Member
    Posted 1 year ago #

    You're welcome! I'm glad I could help. :)

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic

Tags

No tags yet.