- This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
Viewing 4 posts - 1 through 4 (of 4 total)
- The forum ‘Other’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
I am new to WP and here’s a question:
when a WP web site has a slider on the home page but not on any other page, is this done by using something like a page-home.php with the slider coded in it for the home page or is it normally done using some other method? obviuosly if the slider code is contaned in header.php, it will show up on all pages, so it cannot be there.
still trying to figure out the ins and outs of WP
Al
Yep, that would be hardcoded into an index.php file. That’s your home page, the other pages run off the page.php template unless you need them to be unique, in which case you can specify particular php templates for particular pages.
index.php – Home Page
page.php – Pages
single.php – Posts
In your case, I would do something like this:
HOME – index.php (custom code that includes a slider, don’t link to sidebar)
ABOUT – page.php
BLOG – blog.php (custom template, not recognized by WordPress as a default, make sure to include Template Name at top of file to be able to select it as a template when you create the ‘Blog’ page)
PORTFOLIO – portfolio.php (custom template)
CONTACT – page.php
If you want different sidebars to appear on different pages, you can set that up with a bunch of ‘if statements’ in sidebar.php.
Technically, there is no ‘best way’ to do it here. Some people prefer to use home.php as their home page, I prefer to use index.php.