Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // args
- $args = array(
- 'numberposts' => -1,
- 'post_type' => 'event',
- 'meta_query' => array(
- 'relation' => 'OR',
- array(
- 'key' => 'location',
- 'value' => 'INDIA',
- 'compare' => 'LIKE'
- ),
- array(
- 'key' => 'location',
- 'value' => 'US',
- 'compare' => 'LIKE'
- )
- )
- );
- // query
- $the_query = new WP_Query( $args );
- ?>
- <?php if( $the_query->have_posts() ): ?>
- <?
- ******************************************
- //Add code here to count the posts of INDIA and US
- Psuedo code is as shown below
- iF meta.LOCATION ="INDIA"
- get row count (Locaton-->india)
- endif
- iF meta.LOCATION ="US"
- get row count (Locaton-->india)
- endif
- ***********************************
- <?php endif; ?>
- <?php wp_reset_query(); // Restore global post data stomped by the_post(). ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement