Auto-detect Category
-
The code I’m using right now is displaying the 6 newest posts, but I’d like to have it auto-detect the category the post is in, so in single.php and category.php the code would display the posts in that specific category.
Can someone help me with this?
<?php $my_query = new WP_Query('showposts=6'); while ($my_query->have_posts()) : $my_query->the_post(); $do_not_duplicate = $post->ID; ?> <div id="contentslider_menu"><div class="contentslider_menubalk_streep"><div class="contentslider_menubalk"><ul><li><a href="<?php the_permalink(); ?>" class="toc"> <p class="wit"><?php the_title(); ?></p> </a></li></ul></div></div></div> <?php endwhile; ?>
- The topic ‘Auto-detect Category’ is closed to new replies.