SHOW:
|
|
- or go back to the newest paste.
| 1 | - | <?php |
| 1 | + | <div class="latest_opinions"> |
| 2 | - | $paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1;
|
| 2 | + | <h3 class="section_title">Opinions</h3> |
| 3 | - | $custom_args = array( |
| 3 | + | <!-- loop the first 10 opinion posts here --> |
| 4 | - | 'post_type' => array('opinions', 'ideas'),
|
| 4 | + | <?php get_template_part( 'partials/opinions-excerpt' ); ?> |
| 5 | - | 'posts_per_page' => 20, |
| 5 | + | </div> |
| 6 | - | 'paged' => $paged |
| 6 | + | |
| 7 | - | ); |
| 7 | + | <div class="latest_ideas"> |
| 8 | - | $the_query = new WP_Query( $custom_args ); ?> |
| 8 | + | <h3 class="section_title">Ideas</h3> |
| 9 | <!-- loop the first 10 ideas posts here --> | |
| 10 | - | <?php if ( $the_query->have_posts() ) : ?> |
| 10 | + | <?php get_template_part( 'partials/ideas-excerpt' ); ?> |
| 11 | </div> | |
| 12 | - | <!-- the loop --> |
| 12 | + | |
| 13 | - | <?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?> |
| 13 | + | <!-- single pagination for BOTH post types here --> |
| 14 | - | <?php if ( get_post_type( get_the_ID() ) == 'opinions' ):?> |
| 14 | + | |
| 15 | - | <?php get_template_part( 'partials/opinions-excerpt' ); ?> |
| 15 | + | |
| 16 | - | <?php else if ( get_post_type( get_the_ID() ) == 'ideas' ):?> |
| 16 | + | |
| 17 | - | <?php get_template_part( 'partials/ideas-excerpt' ); ?> |
| 17 | + | |
| 18 | - | <?php endif;?> |
| 18 | + | ?> |