Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $q = new WP_Query( 'posts_per_page=5' );
- $args = array (
- 'post_type' => 'custom_post',
- 'nopaging' => false,
- 'posts_per_page' => '5',
- 'order' => 'DESC',
- 'orderby' => 'ID',
- );
- $query = new WP_Query( $args );
- if ( $query->have_posts() ) {
- while ( $query->have_posts() ) {
- $query->the_post();
- // display content
- }
- } else {
- // display when no posts found
- }
- wp_reset_postdata(); // Restore original Post Data
- $args = array(
- 'post_type' => 'blog_posts',
- 'posts_per_page' => '5',
- );
- $query = new WP_Query($args);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement