Home
How to customize Front Page layout WordPress PDF Print E-mail
Written by Administrator   
Tuesday, 29 December 2009 11:42

For customizing Front Page in WordPress You have three different ways: You can add home.php in Your  active Theme, add simple php code or add Front Page Plugin for WordPress. In this variants i'll use Default WordPress Theme You can find it in FTP: wp-content/themes/default/. Ok, let's consider this variants in detail:

 

 

1. Adding simple code in Your active Theme pages:


<?php if ( is_front_page() ) {?>
html for home page
<?php }else{?>
html for other pages
<?php }?>

For example we want to customize content and remove sidebar from Home Page, we need change page.php in default Theme. Open page.php, You can find it on FTP: wp-content/themes/default/page.php and add this code:


<?php
/**
* @package WordPress
* @subpackage Default_Theme
*/

get_header(); ?>

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

<div id="content" class="HomePageNarrowcolumn" role="main">
...
</div>

<?php }else{?>

<div id="content" class="narrowcolumn" role="main">
...
</div>
<?php get_sidebar(); ?>

<?php }?>

<?php get_footer(); ?>

 

2. The second way add home.php in Your active Theme. WordPress will recognize a home.php document in your template directory and use it rather than index.php to theme Your front page.

 

3. Front Page Plugin For WordPress.
The Opt-In Front Page plugin lets you add posts to your front page on an opt-in basis, rather than remove posts on an opt-out basis. This allows you to manage any number of asides categories.

In short, only posts in your "Blog" (or "News") category will appear on your front page and its RSS feed when you use this plugin.

It changes your main category's url as relevant, and it fallbacks to normal blog mode when no 'blog' (or 'news') category exists or when the latter is empty.

You can safely change your "Blog" or "News" category's name after it is created: The opt-in front page plugin looks for the category with a slug of "blog" or "news".

Download this plugin

 

In conclusion i want to say that You can use all this variants. In my WordPress projects I used first variant with php code as for me its more simple :)


Last Updated on Tuesday, 29 December 2009 15:32
 

Add comment


Security code
Refresh

© 2010. Sopov.com