Page Template different results after 3.8.1
-
I have some posts with a status of publish and publish date in the future. These are controlled by page templates.
I have one page where I want to display one post with a future publish date and then other posts in the past but controlled by List Category Posts plugin.
This was working perfectly before changing from version 3.2 to 34.8.1
NOW, under 3.8.1, the List Category Posts plugin ONLY shows posts with a future publish date. Website https://www.birminghamchoralunion.org.uk/wordpress/
Code in the relevant page template is:
<?php
/**
* Template Name: next_concert_home
*/get_header(); ?>
<?php
/* Run the loop to output the pages.
* If you want to overload this in a child theme then include a file
* called loop-page.php and that will be used instead.
*//* Check if the user selects specific category for the templated page */
$cats = ‘concerts’; // Change these category SLUGS to suit your use.// Display the posts from the category with a post_date in the future
$args= array(
‘category_name’ => $cats
);// The Query
// $the_query = new WP_Query( $args );function filter_where($where = ”) {
$where .= ” AND post_date >= ‘” . date(‘Y-m-d’) . “‘”;
return $where;
}
add_filter(‘posts_where’, ‘filter_where’);$my_query = new WP_Query(‘category_name=concerts&order=ASC&posts_per_page=1’);
// The Loop
// while ( $the_query->have_posts() ) : $the_query->the_post();
while ($my_query->have_posts()) : $my_query->the_post();// echo ‘
- ‘;
// the_title();
// the_content();get_template_part( ‘loop’, ‘index’ );
// echo ‘
‘;endwhile;
the_post();
get_template_part( ‘loop’, ‘page’ );// Reset Post Data
wp_reset_postdata();?>
<?php get_footer(); ?>
- The topic ‘Page Template different results after 3.8.1’ is closed to new replies.