I am attempting to write a template for any Wordpress site for a static top of the page (with a few dynamic content). I have produced the Page, and hang it to make use of my 'Home' template (that is held in
frontpage.php file is similar to my
page.php file, employed for exhibiting pages like 'About' and 'Contact'. However, after i visit my top of the page, it shows this content of three pages: Home, About and phone.
It appears such as the Wordpress loop, which just will get this content of merely one page on About and phone, gets this content of pages after i visit Home. What is leading to this?
page.php appears like this:
<?php get_header(); ?> <div id="content"> <?php while(have_posts()) : the_post() ?> <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <h2 class="entry-title"><?php the_title(); ?></h2> <div class="entry-content"> <?php the_content(); ?> </div><!-- .entry-content --> <?php edit_post_link('Edit', '<p>', '</p>'); ?> </div><!-- #post-<?php the_ID(); ?> --> <?php endwhile; ?> </div><!-- #content --> <?php get_footer(); ?>
[Using Wordpress 3.2.1.]
because you will find the while loop, it shows all of the pages, right before the while loop, alter the following code to change the query.
<?php get_header(); ?> <div id="content"> <?php query_posts('p=5');//substitute 5 with the front page id while(have_posts()) : the_post() ?> ....the same...
hope it will help.
You might like to have a look inside your Wordpress admin at "Configurations -> Reading through". Automatically, the home page is a listing of articles, you have to change this to some static page. Hope this may fixes your condition!
Example below of the Wordpress site I build with a static page named
Homepage as frontpage:
Ultimately, I could not evaluate which was failing. What I have done is produced a static page named Home, designed a custom template for this in
page-home.php, and rerouted
index.php towards the Home page's URL like so:
<meta HTTP-EQUIV="REFRESH" content="0; url=<?php bloginfo('url'); ?>/home/">
It isn't ideal, however it works perfectly well.