Advertisement
Guest User

Untitled

a guest
Jan 21st, 2017
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. <?php
  2.  
  3. // args
  4. $args = array(
  5. 'numberposts' => -1,
  6. 'post_type' => 'event',
  7. 'meta_query' => array(
  8. 'relation' => 'OR',
  9. array(
  10. 'key' => 'location',
  11. 'value' => 'INDIA',
  12. 'compare' => 'LIKE'
  13. ),
  14. array(
  15. 'key' => 'location',
  16. 'value' => 'US',
  17. 'compare' => 'LIKE'
  18. )
  19. )
  20. );
  21.  
  22.  
  23. // query
  24. $the_query = new WP_Query( $args );
  25.  
  26. ?>
  27. <?php if( $the_query->have_posts() ): ?>
  28.  
  29. <?
  30. ******************************************
  31. //Add code here to count the posts of INDIA and US
  32. Psuedo code is as shown below
  33. iF meta.LOCATION ="INDIA"
  34. get row count (Locaton-->india)
  35. endif
  36. iF meta.LOCATION ="US"
  37. get row count (Locaton-->india)
  38. endif
  39. ***********************************
  40.  
  41. <?php endif; ?>
  42. <?php wp_reset_query(); // Restore global post data stomped by the_post(). ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement