daily pastebin goal
1%
SHARE
TWEET

Wyświetlanie postów z tej samej kategorii

a guest Dec 17th, 2016 13 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. $cats = wp_get_post_categories($post->ID, array(
  4.     'fields' => 'ids'
  5. ));
  6.  
  7. $posts = new WP_Query(array(
  8.     'category' => $cats
  9. ));
  10.  
  11. while($posts->have_posts()) {
  12.     $posts->the_post();
  13.     // itd...
  14. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top