Solved

custom wordpress front page

Posted on 2011-03-20
4
318 Views
Last Modified: 2012-05-11
Hi what is the best way of having a custom front page on word press?

Thanks.
0
Comment
Question by:wilflife
  • 2
4 Comments
 
LVL 70

Expert Comment

by:Jason C. Levine
Comment Utility
Hi wilflife,

What exactly do you mean by "custom"?

A splash page?  Custom content instead of recent posts?
0
 

Author Comment

by:wilflife
Comment Utility
Basically a different format on the front page to the other pages.
0
 
LVL 70

Assisted Solution

by:Jason C. Levine
Jason C. Levine earned 200 total points
Comment Utility
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
 
LVL 23

Accepted Solution

by:
jeremyjared74 earned 300 total points
Comment Utility
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

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Who says nothing in life is free? WordPress.com is a freebie. WordPress.org's downloadable publishing platform is free. Heck, even WordPressMU is free. WordPress is an open source project, which means it can be used on any personal or commerc…
In order to have all security and back ups taken care of, WordPress users can sign up for services with WP Engine.
The purpose of this video is to demonstrate how to make a WordPress Site faster and smaller in size by cleaning up the database. This will be demonstrated using a Windows 8 PC. Plugin WP Optimize will be used. Go to your WordPress login page. T…
The purpose of this video is to demonstrate how to set up basic WordPress SEO. This will be demonstrated using a Windows 8 PC. The plugin used will be WordPress SEO by Yoast. Go to your WordPress login page. This will look like the following: myw…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now