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(); ?>

Kimmi,
Can you post the PHP of the functions that are being called here?
Perhaps you could use JING or something and post some URLs to screenshots as well?
You mention the prase "when I call the title and the text" Does that refer to lines 57 and 58? I so, are hey showing data that shoule have been rendered in 32 and 33?
With a little more detail, we may get this figured out. ;-)

DougVann [Drupal Trainer, Consultant, Developer]

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.