Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // WP_Query arguments
- $args = array (
- 'post_type' => array( 'gym' ),
- 'order' => 'ASC',
- 'orderby' => 'date',
- 'meta_query' => array(
- array(
- 'key' => 'cast',
- 'value' => 'Boss - test',
- 'compare' => 'LIKE',
- ),
- ),
- );
- // The Query
- $query = new WP_Query( $args );
- // The Loop
- if ( $query->have_posts() ) {
- while ( $query->have_posts() ) {
- $query->the_post();
- echo the_title();
- }
- } else {
- // no posts found
- }
- // Restore original Post Data
- wp_reset_postdata();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement