Advertisement
afsarwebdev

WP standard post format display in multiple post format

May 24th, 2018
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. //From multiple post format only standard post format display
  2. <?php
  3. $g_post = new WP_Query(array(
  4. 'post_type' => 'post',
  5. // 'offset' => 4,
  6. 'posts_per_page' => 3,
  7. 'tax_query' => array(
  8. array(
  9. 'taxonomy' => 'post_format',
  10. 'field' => 'slug',
  11. 'terms' => array( 'post-format-gallery', 'post-format-aside' ),
  12. 'operator' => 'NOT IN'
  13. )
  14. )
  15. ));
  16. ?>
  17. <?php if ($g_post->have_posts()): while ($g_post->have_posts()) : $g_post->the_post(); ?>
  18.  
  19. //HTML dynamic code here
  20.  
  21. <?php endwhile;
  22.  
  23. else :
  24. echo wpautop('Sorry, no posts were found');
  25. endif;
  26. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement