Future posts in single view – help!
-
I posted this in the How To forum but it might be more suited here.
This is very weird, and an urgent problem – if anyone has any clues as to what’s going on, please do let me know asap…
I have a page which pulls in future posts to create an events page.
The single view shows the post using this code:
<?php /* If this is in category Events show Event posts */ if (in_category(4) && is_single()) { ?> <?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <!-- LEFT WIDE COLUMN --><div id="left-column-wide"> <div <?php post_class() ?> id="post-<?php the_ID(); ?>"> <h2><?php the_title(); ?></h2> <div id="event-details-main"> <h3><?php the_time('l, F jS, Y') ?></h3> <?php // this is where the custom field prints the event's start and end times $values = get_post_custom_values("event-time"); echo $values[0]; ?>, <?php // this is where the custom field prints the event's venue $values = get_post_custom_values("event-venue"); echo $values[0]; ?><br /> <?php // this is where the custom field prints the event's entry price $values = get_post_custom_values("event-price"); echo $values[0]; ?> </div> <?php the_content('<p class="serif">Read the rest of this entry »</p>'); ?> <?php wp_link_pages(array('before' => '<div class="page-links"><span class="normal">Pages:</span> ', 'after' => '</div>', 'next_or_number' => 'number')); ?> <!-- <?php the_tags( '<p>Tags: ', ', ', '</p>'); ?> --> </div> <div class="commentbox"><?php comments_template(); ?></div> <?php endwhile; else: ?> <p>Sorry, no posts matched your criteria.</p> <?php endif; ?>
And the list of posts in the right-hand sidebar is created with this code:
<?php $my_query = new WP_Query('category_name=events&post_status=future&order=ASC'); ?> <?php if ($my_query->have_posts()) : while ($my_query->have_posts()) : $my_query->the_post(); $do_not_duplicate = $post->ID; ?> <dl class="giglist"> <dt><u><a href="<?php the_permalink(); ?>"><?php the_time('l, F jS, Y') ?></a></u>:</dt> <dd><h4><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h4></dd> <dd><span class="small"><?php // this is where the custom field prints the event's venue $values = get_post_custom_values("event-venue"); echo $values[0]; ?></span></dd> </dl> <?php endwhile;?> <p> </p><p> </p> <h4>Previous Events</h4> <?php $my_query = new WP_Query('category_name=events'); while ($my_query->have_posts()) : $my_query->the_post(); $do_not_duplicate = $post->ID; ?> <dl class="giglist"> <dt><u><?php the_time('l, F jS, Y') ?></u>:</dt> <dd><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></dd> </dl> <?php endwhile; else: ?> <p><?php _e('Sorry, no shows at present.'); ?></p> <?php endif; ?>
The latter code is also used on the Category page, which readers click through to get to the single pages in that category.
But the single pages are throwing up 404 error pages. At least, they are using the validator – the strangest thing is, I can see the posts working fine, despite turning off WP Supercache and clearing my browser’s cache.
This wasn’t an issue til a few days ago, and I haven’t changed anything that I can think of.
Custom permalink structure is:
/%category%/%postname%.html
With category base set at
.
This is one of the pages in question: https://tinyurl.com/pqzpka
Please help if you can!
Thanks
- The topic ‘Future posts in single view – help!’ is closed to new replies.