Cache not working with sticky posts
-
We ran in to an issue where the
cache_control_is_future_now_maxtime
function was causing our homepage to generateCache-Control: none
header because theWP_Query
call was returning stickied posts even though they have apost_status
ofpublished
.I applied the following patch which fixed our issue.
Index: cache-control.php =================================================================== --- cache-control.php (revision 1691962) +++ cache-control.php (working copy) @@ -140,6 +140,7 @@ function cache_control_is_future_now_maxtime( $max_time_future ) { // trusting the database to cache this query $future_post = new WP_Query( array( 'post_status' => 'future', + 'ignore_sticky_posts' => true, 'posts_per_page' => 1, 'orderby' => 'date', 'order' => 'ASC'
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Cache not working with sticky posts’ is closed to new replies.