WP shows all categories, only want one
-
Hello!
I’ve posted a question like this earlier, but never got a good answer. However, I do believe I understand my problem somewhat better now.
I am developing a theme of my own, and I am having troubles with the categories-pages. I am given to understand that WP is supposed to automaticly show only the posts with the category of the category page (i.e only sport posts on the sports-category page). However, on my sports-category page all posts show up no matter the category. This is quite annoying, does anyone know why this happens and how I could fix it?
If it is of any help my website can be found here.
And my category.php code is this
<?php get_header();?> <section class="featured-post fifteen columns row"> <h1><?php single_cat_title(); ?></h1> <ul> <?php $args = array('posts_per_page' => 6, 'post_type' => 'larsarholmnet_posts' ); $query = new WP_Query( $args ); while ($query->have_posts()) : $query->the_post(); ?> <div class="cat-thumb"> <a>"> <h2><?php the_title();?></h2> <?php the_post_thumbnail('cat-thumb'); ?> <p><?php the_excerpt(); ?></p> </a></div> <?php endwhile;?> </ul> <div id="push"></div> </section> <?php get_sidebar();?> <?php get_footer();?>
Thank you very much your for responses!
- The topic ‘WP shows all categories, only want one’ is closed to new replies.