WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] which template to look into for a missing sidebar (2 posts)

  1. sachi21
    Member
    Posted 7 years ago #

    I did a search and noticed others had similar issues but really couldn't find one that had an answer.

    the problem;
    My homepage has the sidebar and its respective links.
    However, once I click on any other page on the site, the sidebar content is no longer there.

    I looked within the index.php and single.php files and both have the sidebar command code; <?php get_sidebar(); ?>

    Thus, I'm not quite sure what the next step is to diagnose the problem if both templates have the appropriate command code.

    Thoughts?

  2. sachi21
    Member
    Posted 7 years ago #

    Hey all,

    I asked around and the issue is fixed. It turns out that if/else statement in my sidebar.php template was missing the appropriate code that will list the sidebar in every page. Here is how to fix the issue;

    Before;

    <?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar() ) : else : ?>
    <?php if(is_home() ) { ?>

    AFTER;

    <?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar() ) : else : ?>
    <?php if(is_home() || is_page() ) { ?>

    I will close this thread.

    Mods, feel free to point people to this post if they have similar issues.

    Thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.