Hi folks:
I'm adapting a theme and I've encountered a problem whereby the third column gets repeated twice on the front page except when the Recent Posts widget is activated in the second column. Somehow the is_paged is getting mangled except when the widget is activated.
index.php:
<?php
get_header();
?>
<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; ?>
<div id="filler" class="fix">
<?php /* Feature Column */ ?>
<?php if (!is_paged()) include (TEMPLATEPATH . '/feature.column.php'); ?>
<?php /* End Feature Column */ ?>
<div id="mainColumn">
<?php query_posts('showposts=5&paged=' . $paged); ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php if (array_search(get_the_ID(), $do_not_duplicate) !== false)
continue; update_post_caches($posts); ?>
<div id="post-<?php the_ID(); ?>" <?php post_class('post'); ?>>
<div class="postMeta">
<p class="container">
<span class="date"><?php the_time('M j, Y') ?></span>
<span class="comments"><?php comments_popup_link('0', '1', '%'); ?></span>
</div>
<h2><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title() ?></a></h2>
<div class="entry">
<?php the_content('Read the rest of this entry »'); ?>
</div>
<p class="postmetadata"><?php the_tags('Tags: ', ', ', ''); ?> Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?>
</div>
<?php endwhile; ?>
<?php else : ?>
<div class="post">
<div class="postMeta">
<p class="container">
<span class="date">No Matches</span>
</div>
<h2>No matching results</h2>
<div class="entry">
You seem to have found a mis-linked page or search query with no matching results. Please trying your search again. If you feel that you should be staring at something a little more concrete, feel free to email the author of this site or browse the archives.
</div>
</div>
<?php endif; ?>
<div id="paginateIndex" class="fix">
<span class="left"><?php previous_posts_link('« Previous') ?></span> <span class="right"><?php next_posts_link('Next »') ?></span>
</div>
</div>
<?php include (TEMPLATEPATH . '/second.column.index.php'); ?>
<?php if (is_paged()) include (TEMPLATEPATH . '/third.column.shared.php'); ?>
</div>
<?php get_footer(); ?>
feature.column.php:
<div id="featureColumn">
<div class="featured">Featured</div>
<?php query_posts(array('post__in'=>get_option('sticky_posts'))); ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php $do_not_duplicate[] = get_the_ID(); ?>
<div id="post-<?php the_ID(); ?>" <?php post_class('post'); ?>>
<div class="postMeta">
<p class="container">
</div>
<h2><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title() ?></a></h2>
<div class="entry">
<?php the_content('Read the rest of this entry »'); ?>
</div>
<p class="postmetadata"><?php the_tags('Tags: ', ', ', ''); ?> Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?>
</div>
<?php endwhile; endif; ?>
</div>
<?php include (TEMPLATEPATH . '/third.column.shared.php'); ?>
second.column.index.php:
<div class="secondaryColumn">
<?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar('Primary - Index') ) : else : ?>
<?php endif; ?>
</div>
third.column.shared.php:
<div id="tertiaryColumn">
[contains hard coded stuff. no widgets used or harmed in the making of this column]
</div>
I've tried assorted other widgets in the second column, even no widgets, but the third column keeps getting repeated unless I drop in the recent posts widget.
Any assistance or suggestions would be much appreciated. Thank you.
skribe