Home › Forums › Back End › Different sidebar for home and posts page WordPress › Re: Different sidebar for home and posts page WordPress
The home page will use the template "index.php". A post’s page will use "single.php".
First you need to decide how many types of pages each sidebar will appear on. For example, if the sidebar on the homepage is ONLY going to be seen on the home page (not on a category page, blog page, single page, post page, etc etc) then do the following:
1. Duplicate your sidebar.php and give it a new name (like, sidebar-home.php).
2. Open up your index.php and find
and replace it with
3. Open up your sidebar.php and edit it to show what you want on single.php, category.php, etc etc.
If the sidebar on the homepage is going to be used elsewhere in the site, then you’re going to want to do the opposite of above:
1. Create a new sidebar.php and give it a new name (like, sidebar-single.php) and edit it to only show what you want to see on a post’s page.
2. Open up your single.php and find
and replace it with
That was sort of weirded confusingly, but I hope you get the idea.