Hi,
The home page of the website I'm creating displays an excerpt on multiple pages and below I need to display the text of the home page.
The problem I'm having is when I call the title and the text, it's displaying the title and the text of the last page I got the excerpt for. Can someone help me with this?
get_header(); ?>
<div id="middlesection">
<div class="container">
<img src="<?php bloginfo(stylesheet_directory); ?>/images/line.png" alt="" /> <p></p>
Brisbane & South East Queensland's leading supplier of road based products. <p></p>
<img src="<?php bloginfo(stylesheet_directory); ?>/images/line.png" alt="" />
</div>
<div id="middlenavigation">
<div class="container">
<div class="aboutbox">
<?php query_posts('page_id=7'); ?>
<?php while (have_posts()) : the_post(); ?>
<?php the_post_thumbnail(); ?>
<?php endwhile; ?>
<div class="aboutexcerpt">
<?php
$post_id = 7; // substitute the actual post ID for "2"
$my_post = get_post($post_id);
echo "<h3>$my_post->post_title</h3>";
echo "<p>$my_post->post_excerpt</p>";
?>
</div>
<div class="more">
find out more
</div>
</div>
<div class="aboutbox">
<?php query_posts('page_id=5'); ?>
<?php while (have_posts()) : the_post(); ?>
<?php the_post_thumbnail(); ?>
<?php endwhile; ?>
<div class="aboutexcerpt">
<?php
$post_id = 5; // substitute the actual post ID for "2"
$my_post = get_post($post_id);
echo "<h3>$my_post->post_title</h3>";
echo "<p>$my_post->post_excerpt</p>";
?>
</div>
<div class="more">
find out more
</div>
</div>
<div class="aboutbox">
<?php query_posts('page_id=11'); ?>
<?php while (have_posts()) : the_post(); ?>
<?php the_post_thumbnail(); ?>
<?php endwhile; ?>
<div class="aboutexcerpt">
<?php
$post_id = 11; // substitute the actual post ID for "2"
$my_post = get_post($post_id);
echo "<h3>$my_post->post_title</h3>";
echo "<p>$my_post->post_excerpt</p>";
?>
</div>
<div class="more">
find out more
</div>
</div>
<div class="aboutbox1">
<?php query_posts('page_id=17'); ?>
<?php while (have_posts()) : the_post(); ?>
<?php the_post_thumbnail(); ?>
<?php endwhile; ?>
<div class="aboutexcerpt">
<?php
$post_id = 17; // substitute the actual post ID for "2"
$my_post = get_post($post_id);
echo "<h3>$my_post->post_title</h3>";
echo "<p>$my_post->post_excerpt</p>";
?>
</div>
<div class="more">
find out more
</div>
</div>
</div>
</div>
</div>
<div id="homecontent">
<div class="container">
<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php if ( is_front_page() ) { ?>
<?php } else { ?>
<?php } ?>
<div class="entry-content">
<h2><?php the_title(); ?></h2>
<?php the_content(); ?>
</div><!-- .entry-content -->
</div><!-- #post-## -->
<?php endwhile; ?>
</div>
</div>
<?php get_footer(); ?>