Hi all, I have a theme which I’m trying to customize but I’m a novice with PHP. The front page uses category posts to display spotlights but I want to prevent posts from this category showing up in the news archive/feed. So they shouldn’t be hidden from the site completely, just not appear anywhere else apart form the front page. On the blog page it uses the following loop to get the posts:
…
$blog_query = new WP_Query( array( ‘post_type’ => ‘post’, ‘paged’ => $paged ) );
$temp_query = $wp_query;
$wp_query = null;
$wp_query = $blog_query;
if( $blog_query->have_posts() ) {
while( $blog_query->have_posts() ) {
$blog_query->the_post();
do_action( ‘mytheme_before_post’ );
…
There’s a way to do it here but I don’t know to combine the two:
https://wordpress.org/support/topic/exclude-category-in-side-bar-using-get_archives?replies=5