Advertisement
Guest User

Untitled

a guest
Dec 7th, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. <?php
  2. define( 'WP_DEBUG', true );
  3. $args = array(
  4. 'post_type' => 'realizacje',
  5. 'tax_query' => array(
  6. array(
  7. 'taxonomy' => 'category',
  8. 'field' => 'slug',
  9. 'terms' => 'kawalerki'
  10. )
  11. )
  12. );
  13.  
  14. $testimonials = new WP_Query($args);
  15. if( $testimonials->have_posts() ) :
  16. ?>
  17. <ul>
  18. <?php
  19. while( $testimonials->have_posts() ) :
  20. $testimonials->the_post();
  21. ?>
  22. <li><?php printf( '%1$s - %2$s', get_the_title(), get_the_content() ); ?></li>
  23. <?php
  24. endwhile;
  25. wp_reset_postdata();
  26. ?>
  27. </ul>
  28. <?php
  29. else :
  30. esc_html_e( 'No testimonials in the diving taxonomy!', 'text-domain' );
  31. endif;
  32. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement