Show only one category in specific wp-query code
-
Hi,
I have an extra static page named “news” with the blog-template.php of my theme (Pinboard from onedesigns).
Can somebody tell how to edit the following code in the blog-template.php to only show one specific category (ID 5 in my case)?
I know that simiplar problems have appeared 100+ times but in every search result I found the code was different from the code in the template I use!<?php global $wp_query, $wp_the_query; ?> <?php $wp_query = new WP_Query( $args ); ?> <?php if( $wp_query->have_posts() ) : ?> <div class="entries"> <?php while( $wp_query->have_posts() ) : $wp_query->the_post(); ?> <?php get_template_part( 'content', get_post_format() ); ?> <?php endwhile; ?> </div>I’ve tested several “hide”-plugins and stuff for hours and I’m really despair about this problem.
Can you help me, please?
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
The topic ‘Show only one category in specific wp-query code’ is closed to new replies.