WordPress.org

Forums

[Theme: _s] Archives Using home.php Template (5 posts)

  1. Alli
    Member
    Posted 1 year ago #

    I have a theme developed using _s that I do not want to include the sidebar.php file. My archives.php and paged.php files do not have the sidebar.php included, but I was still seeing the sidebar content at the bottom of my page (I have the sidebar content at the bottom instead of on the side). I really only want that content to appear on the main page, so I created a home.php file to include the sidebar and removed it from the index.php file, but I'm still seeing the sidebar content when I go to view more posts.

    Here is my home page: http://www.allirense.com/staging
    Here is the archive page: http://www.allirense.com/staging/?paged=2

    The sidebar content I do not want to show up is the "More Posts" section at the bottom. What am I doing wrong?

  2. missybunnie
    Member
    Posted 1 year ago #

    Check the archive.php file and make sure there is no get_sidebar() function. Also double check that your archive file is archive.php and not archives.php

  3. missybunnie
    Member
    Posted 1 year ago #

    Also something I just thought of is if you really want to just have your sidebar on the front page you could make a template file like front-page.php and add the comment

    /* Template Name: Front Page */

    And then it will give you a drop down on your pages that will let you pick that template for whatever pages you want a sidebar on.
    Just a second thought if the above doesn't work

  4. Where did you get this theme from?

    Better yet, what theme is it? There are several themes I've come across that are based on the _s theme.

  5. Alli
    Member
    Posted 1 year ago #

    It is archive.php (my mistake adding the s in my initial post) and it definitely does not have the get_sidebar() function.

    I don't think the template tame trick would work since I want the sidebar to appear only on the front landing page of the blog and not any individual pages, posts, archive pages, category pages, etc.

    This is a theme I've been building myself based on _s.

Topic Closed

This topic has been closed to new replies.

About this Topic