WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Show Sidebar on just home page (3 posts)

  1. Evoroth
    Member
    Posted 5 years ago #

    I was wondering if it was possible to show sidebar.php on just the home page of a skin?

    The setup I have is that the home page of my site/skin is made up from a page as opposed to a series of posts and then I have multiple pages on the site after that. However, the information I have in my sidebar (for example a list of services), I only want to show on the home page.

    I've tried a couple of ways myself but it shows on every page and now I'm not sure where to go from here or if it's possible.

    Any help is greatly appreciated.

  2. stvwlf
    Member
    Posted 5 years ago #

    Hi

    First determine which template is being used to display your homepage. If it is a page, its likely to be page.php

    change the call to include the sidebar to this:

    <?php if (is_front_page()) {
      get_sidebar();
    ?>

    in all the other templates, remove or place comments around the call to the sidebar
    <?php // get_sidebar(); ?>
    Then the sidebar will not be included when that template is being used.
    index.php
    single.php
    category.php
    archive.php possibly others

  3. Evoroth
    Member
    Posted 5 years ago #

    That's perfect! Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic