lucasbhealy
Member
Posted 7 months ago #
Hello,
I am developing a site locally using a whiteboard child theme.
I essentially want to create a one column homepage, with a sidebar on the rest of the site. I think the best way to go about this is to create a custom page template, but I don't even see the option to pick a template when I am creating a page in my wp-admin. Is this a feature not accessible from the whiteboard theme? thanks
It depends on whether you set your home page to display the latest blog posts, in which case you could create a php template in your theme called home.php or "a static page" in which case you could create a template called front-page.php. In either case, you would not have to include the call to the sidebar.php if you don't want it there, and in fact the page can look completely different from any other page in your site.
Read about the template hierarchy to learn how to give the appropriate file names to your php templates so they will come into effect when you want them to.
http://codex.wordpress.org/Template_Hierarchy
Here is an example of a simple site with a home page that is completely different from the rest of the site...
http://artists-n-order.com/
HTH
BTW there are no sidebars on any pages on that site, and there are javascript rollovers on the home page, just showing that you can do these things.
lucasbhealy
Member
Posted 7 months ago #
Thank you Jonas.
Using your help I've got the custom template front-page.php for my static homepage. Now I want call a different CSS for the front-page.php so I can reformat the column width, etc.
So far I've put this:
<?php if( is_front_page() || is_home() || is_404() ) { ?>
<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'template_url' ); ?>/front-page.css" />
<?php } ?>
In the head of my header.php. I've also just put a few lines of code in front-page.css to see if front_page.php is calling CSS from it. It doesn't appear to be happening. Any ideas?
Thank you guys so much.
There are a few ways to do it. Either write the header code into front-page.php instead of calling in your header.php file, or write conditional code into header.php using is_front_page().
http://codex.wordpress.org/Conditional_Tags
Either of those ways you could call in a different stylesheet for that page.
Another way to do it would be to change the the names of the css elements in front-page.php to new, unique names and add the new names & attributes to the css of your theme. So, for example, if there is a div ID in front-page.php named "content" change it to home-content and also add home-content to your css.
HTH
lucasbhealy
Member
Posted 7 months ago #
Jonas,
I really appreciate your time. You've been an excellent help.