custom wordpress front page

Hi what is the best way of having a custom front page on word press?

Thanks.
wilflifeAsked:
Who is Participating?
 
jeremyjared74Connect With a Mentor Commented:
Another way to do it would be to create a custom page. Just copy your header.php, your page.php, sidebar.php, and footer.php. You will want to open a blank text document first. The first thing to put inside the new document is the part that allows you to use select if from the page type dropdown list in the WordPress post or page editor:
HERE IS THE ENTIRE CODE FOR THE EXAMPLE CUSTOM PAGE:
<?php

/*

Template Name: Custom Name

*/

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<html xmlns="http://www.w3.org/1999/xhtml">
 
<head>
 
<title><?php if ( is_home() ) { ?><? bloginfo('name'); ?> <?php bloginfo('description'); } else { wp_title(' '); ?> by <? bloginfo('name'); } ?></title>
 
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
 
<link rel="shorcut icon" type="image/x-ico" href="<?php bloginfo('template_url'); ?>/favicon.ico" />
 
<link href="<?php bloginfo('stylesheet_url'); ?>" rel="stylesheet" type="text/css" />
 
<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/javascript/imghover.js"> </script>
 
<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php bloginfo('rss2_url'); ?>" />
<link rel="alternate" type="text/xml" title="RSS .92" href="<?php bloginfo('rss_url'); ?>" />
 
<?php wp_head(); ?>
</head>
<body>
 
<!-- header START -->
<div class="Header">
<h1><a href="<?php echo get_option('home'); ?>/"><?php bloginfo('name'); ?></a></h1>
<div class="Desc"><?php bloginfo('description'); ?></div> 
<!-- header END -->
 
<!-- container START -->

<div class="Container">


<!-- Here is the page.php code example -->


<div id="content" class="narrowcolumn single-page">

    <div class="post-wr">

<div class="post-foot">
                <div class="post-body">
		<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
		<div class="post" id="post-<?php the_ID(); ?>">
		<h2><?php the_title(); ?></h2>
			<div class="entry">
				<?php the_content('<p class="serif">Read the rest of this page &raquo;</p>'); ?>

				<?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>

			</div>

		</div>

		<?php endwhile; endif; ?>

	<?php edit_post_link('Edit this entry.', '<p>', '</p>'); ?>
	

	
<!-- Begin Sidebar.php -->	
	

	<div id="sidebar">


<?php

	if ( ! dynamic_sidebar( 'primary-widget-area' ) ) : ?>

<?php get_search_form(); ?>

	<h3><?php _e( 'Archives', 'twentyten' ); ?></h3>

<?php wp_get_archives( 'type=monthly' ); ?>

<?php endif; // end primary widget area ?>

<?php

	if ( is_active_sidebar( 'secondary-widget-area' ) ) : ?>

<?php dynamic_sidebar( 'secondary-widget-area' ); ?>

<?php endif; ?>

	</div>

		</div>
		
<!-- Here is the footer -->

  </div>
</div>
<div id="footer">
<p>Your Text Here, maybe a picture or a custom widget</P>
</div>
<?php wp_footer(); ?>

</div>
  </div>
    </div>
      </div>

</body>

</html>

Open in new window

You just need to note the <div id="whaterver">, and the <div class="anyname">, then style them as you wish using css,
Example:
.anyname{
    display: block;
    height: 100%;
    width: 800px;
     float: left;
}
#whatever {
    display: block;
    height: 100%;
    width: 800px;
     float: left;
}

Open in new window

Make sure you saved your custom page template the same as it is in the top of the file, upload it to your theme folder, then include the css to make it look like you want. When you are in the text editor fro the homepage, you will pick your custom page from the page style drop-down list and save it. Hope that helps.
0
 
Jason C. LevineNo oneCommented:
Hi wilflife,

What exactly do you mean by "custom"?

A splash page?  Custom content instead of recent posts?
0
 
wilflifeAuthor Commented:
Basically a different format on the front page to the other pages.
0
 
Jason C. LevineConnect With a Mentor No oneCommented:
So the problem with WordPress is that all of the redirection occurs from index if WordPress is installed in the public root and the theme is the theme.  If you have not yet installed it, then the easiest solution is to install WordPress one level down (www.yoursite.com/blog for example) and then use index.html as the different page.

Another solution is to detect where a user is coming from (internal or external to the domain) and serve up a different page as needed:

http://wordpresshero.com/hacks/creating-a-splash-page-for-wordpress.html/

A third option is to use a plugin:

http://wordpress.org/extend/plugins/simplesplash/
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.