How can I have a static front page and posts display on a page called Blog? PDF Print Email

If using WordPress as a CMS, you might want to present readers with a static front page, and then display your posts on another page called Blog. To accomplish that follow these instructions:

  • Create a Page and use "My Front Page" for the Page Title. Of course, in the content for that Page, you can enter the information you want presented on your site's front page (see example below if you want to display a post).
  • Create a Page and call it Blog. Nothing needs to be entered in the content field of this Page.
  • In Administration > Settings > Reading set the Front page displays to A static page, and select My Front Page for Front page:, and select Blog for the Posts page:.

If you want to further customize your front page, you can create a Template, and fit it to meet your needs:

  • With the help of the Template Hierarchy article, determine what Template is normally used to display your Pages (e.g. page.php or index.php).
  • Copy that template to myfront.php. If you were using the WordPress Default theme you would copy wp-content/themes/default/page.php to wp-content/themes/default/myfront.php.
  • In Administration > Appearance > Editor, edit the myfront.php and change the beginning of the file from:
<?php
/**
* @package WordPress
* @subpackage Default_Theme
*/

to:

<?php
/*
Template Name: MyFront
*/
?>
  • Then access the Page called Front in Administration > Page > Edit and set the Template to MyFront.
  • Once that's all working, begin changing myfront.php to make it look like what you want.
  • That's it. You are done.

 

Use this example for the 'MyFront' Page Template if you want to display one post, instead of the Page content, on your 'static front page':
<?php
/*
Template Name: MyFront
*/
?>

<?php get_header(); ?>

<div id="content" class="narrowcolumn">

<?php

query_posts('p=1'); //set p=x where x is post id of post you want to see or use query_posts('cat=1&showposts=1); to show one post from Category 1
if (have_posts()) : ?>

<?php while (have_posts()) : the_post(); ?>

<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
<h2><a href="/<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
<small><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></small>

<div class="entry">

<?php the_content('Read the rest of this entry »'); ?>
</div>


<p class="postmetadata"><?php the_tags('Tags: ', ', ', '<br />'); ?> Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?> <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></p>
</div>

<?php endwhile; ?>

<div class="navigation">
<div class="alignleft"><?php next_posts_link('« Older Entries') ?></div>
<div class="alignright"><?php previous_posts_link('Newer Entries »') ?></div>
</div>

<?php else : ?>

<h2 class="center">Not Found</h2>
<p class="center">Sorry, but you are looking for something that isn't here.</p>
<?php get_search_form(); ?>

<?php endif; ?>

</div>

<?php get_sidebar(); ?>

<?php get_footer(); ?>
 

New Joomla Templates

  1. Social ConnectedSocial ConnectedName: Social ConnectedDescription: Social Connected is a new professional, easy to use Joomla template released by the Joomladesigns team which includes custom CSS style layouts for the Jomsocial and K2 Extensions. The Social Connected template includes the following features Three Jooml ...Owner: JoomlaDesignsTags: Computers, Communications, Business, Architecture
  2. ExtendExtendName: ExtendDescription: Extend is a professional easy to use Joomla template released by the Joomladesigns Team. The new Extend template supports the following features Includes Four different Joomla Templates Built-in colour picker to customize the template colour scheme Bui ...Owner: JoomlaDesignsTags: Business, Beauty, Architecture
  3. NgineNgineName: NgineDescription: Ngine is a new professional Joomla template from Joomladesigns.co.uk which supports a wide range of features including Five built-in Joomla templates Slide show Slide pop up boxes K2 CSS styles RTL support Six built in font styles Lots of module posi ...Owner: JoomlaDesignsTags: Software, Portal, News, Games
  4. Simply City 2Simply City 2Name: Simply City 2Description: Simply City is a professional, fast loading Joomla template which is easy to use and includes a wide range of features. The web design also supports CSS styles for the popular K2 extension. The Joomla template includes the following features 3 multi col ...Owner: JoomlaDesignsTags: Computers, Communications, Business
  5. Simply CitySimply CityName: Simply CityDescription: Simply City is a professional, fast loading Joomla template which is easy to use and includes a wide range of features. The web design also supports CSS styles for the popular K2 extension. The Joomla template includes the following features 3 different ...Owner: JoomlaDesignsTags: Electronics, Computers, Communications, Business
  6. Show more...

Search Directory

Explore Directory

Top Joomla Design Teams