Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // WP_Query arguments
- $args = array (
- 'post_type' => array( 'product', 'post' ),
- 'nopaging' => true,
- 'meta_key' => '_featured',
- 'meta_value' => 'yes',
- 'orderby' => 'date',
- 'order' => 'desc',
- );
- // The Query
- $front_query = new WP_Query( $args );
- print_r( $front_query->request );
- // The Loop
- if ( $front_query->have_posts() ) {
- while ( $front_query->have_posts() ) {
- $front_query->the_post();
- get_template_part('templates/content', get_post_type() != 'post' ? get_post_type() : get_post_format());
- }
- } else {
- // no posts found
- echo 'no';
- }
- // Restore original Post Data
- wp_reset_postdata();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement