I just upgraded to 3.4.2 from 2.9 (i know, i know, but if it ain't broke...) I have page templates that are (or at least were) set up to display the page content first, then start a loop of posts, like so:
<div id="content">
<div class="content-title">ABOUT THE SITE</div>
<div id="content-main">
<img src="<?php bloginfo('template_url'); ?>/images/headline.gif" />
<div class="nopad"><?php the_content(); ?></div>
</div>
<div class="content-title" style="color: #05B2A9;">POSTS BY DATE</div>
<div id="comments">
<?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args= array(
'cat' => 8,
'paged' => $paged
);
query_posts($args);
?>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<?php
$key="main img";
$my_main_img = get_post_meta($post->ID, $key, true);
$key="thumb img";
$my_thumb_img = get_post_meta($post->ID, $key, true);
?>
<div <?php post_class() ?>>
<div class="blog-list">
<div class="blog-list-img">
<!-- do stuff -->
</div>
</div>
</div>
<?php endwhile; ?>
<?php else : endif; ?>
<div id="blog-list-more">
<div class="next"><?php previous_posts_link(' ') ?></div>
<div class="previous"><?php next_posts_link(' ') ?></div>
</div>
</div>
</div>
This worked great in 2.9 but in this new upgrade it isn't displaying the page content. I have multiple page templates and was able to fix it on the pages that ran simple queries (like list of the blog contributors) by putting
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
before <div id="content">
, but as you can imagine on the main blog archive page this isn't an option. (I tried just to be sure).
So how does one get the contents of the page outside the main loop? Do I have to run two loops? It seems this would be a simple enough thing but I can't work out how. I can't run a simple query in this page because there's all sorts of crazy stuff going on in there. Or can I?