• I am designing a site for a client using WordPress as a CMS. It can be viewed here https://dev.reciprocity.be/mu/lovs.

    As you can see, the bar below the header and menu currently has excerpts of 3 pages from the site. This part works great. The problem I’m having is how to get the page content to show up in the area below this bar. I have it sort-of working, but the only page content I can get it to show is the Home page. Here’s the code I’m currently using to do the page content area:

    <div id="content">
        <?php query_posts(); ?>
    	<?php while (have_posts()) : the_post(); ?>
    	<h2><?php the_title(); ?></h2>
    
    	<?php the_content("Continue reading " . the_title('', '', false)); ?>
    	<?php endwhile; ?>
    </div>

    Any ideas?

Viewing 1 replies (of 1 total)
  • Thread Starter Keith S.

    (@zarathos)

    Ok, I figured it out. I had to stick the original query into a temporary variable in my template. My index.php now looks like this…

    <!-- Begin Index.PHP -->
    <?php $temp_query = $wp_query; ?>
    
    <?php get_header(); ?>
    
    <?php get_sidebar(); ?>
    
    <div id="content">
        <?php $wp_query = $temp_query; ?>
    
        <?php while (have_posts()) : the_post(); ?>
    	<h2><?php the_title(); ?></h2>
    
    	<?php the_content("Continue reading " . the_title('', '', false)); ?>
    	<?php endwhile; ?>
    </div>
    
    <?php get_footer(); ?>
Viewing 1 replies (of 1 total)
  • The topic ‘Multiple Loops question’ is closed to new replies.