Post not hidden on home.php
-
Hi,
I’m attempting to use this plugin to hide a particular post at https://suscon.org/blog/ (the post is https://suscon.org/blog/2016/09/free-guide-to-beautiful-gardens-that-thrive-in-drought/) It’s hidden on the month archive for Sept 2016, and it’s hidden on the ‘Uncategorized’ category archive, but it’s still showing up on the blog homepage.
I am using a bit of customized code to set the query on that page as compared to the default home.php:
<?php
$first_page_post_count = 7;
$subsequent_pages_post_count = 12;
$paged = $paged ? $paged : 1;
if($paged > 1){
// not first page
$posts_per_page = $subsequent_pages_post_count;
if($paged == 2){
// second page
$offset = $first_page_post_count;} else {
// subsequent pages
$offset = $first_page_post_count + ($subsequent_pages_post_count * ($paged – 2));
}
} else {
// first page
$offset = 0;
$posts_per_page = $first_page_post_count;
}
// The Query$args = array(‘posts_per_page’ => $posts_per_page,
‘offset’ => $offset);
$the_query = new WP_Query( $args );But that’s just so I can have a different number of posts on the first page.
I do have ALL of the boxes under ‘Post Visibility’ checked. Any assistance would be greatly appreciated. Many thanks!
–Carina
- The topic ‘Post not hidden on home.php’ is closed to new replies.