Guest User

Untitled

a guest
Jan 20th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. <?php if(have_posts()): while(have_posts()): the_post(); ?>
  2. // show the single post and get the category of post
  3. <?php endwhile;endif; ?>
  4.  
  5. if(isset($cats_arr) && !empty($cats_arr)){
  6.  
  7. $args = array(
  8. 'category__in' => $cats_arr,
  9. 'posts_per_page'=>3,
  10. 'post__not_in' => array( $post->ID ) );
  11.  
  12. $the_query= new wp_query($args);
  13.  
  14. if($the_query->have_posts()): while($the_query->have_posts()):
  15. $the_query->the_post(); ?>
  16.  
  17. //// shoe same category post title and image
  18. <?php endwhile;endif ?>
  19.  
  20. <?php comments_template(); ?>
Add Comment
Please, Sign In to add comment