• Is there anyway that i can get the category where the post is posted automatically?

    I now of a code that can get a category but i must give the category of where it will get posts.

    <?php
    
    		$the_query = new WP_Query('category_name='. XXXXX . '&' . 'showposts='. XXX);
    
    		while ($the_query->have_posts()) : $the_query->the_post(); $do_not_duplicate = $post->ID;
    ?>

    I plan to put it in my single.php file, so i need it to automatically get the category of where the post is posted and show the other post on the category.

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Help with a code’ is closed to new replies.