Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?
- $project_ids = get_field( 'project_this' );
- $offset = get_query_var( 'paged' ) > 1 ? get_query_var( 'paged' ) * 3 - 3 : 1;
- $args = [
- 'post_type' => 'portfolio',
- 'orderby' => 'id',
- 'order' => 'ASC',
- 'post__in' => wp_parse_id_list( $project_ids ),
- 'posts_per_page' => 3,
- 'offset' => $offset,
- ];
- global $wp_query;
- $i = 0;
- $wp_query = new WP_Query( $args );
- if ( have_posts() ) : while ( have_posts() ) : the_post();
- $i ++; ?>
- <div class="col-md-12 project-item project-item-<?= $i ?>" data-id="<?
- the_ID() ?>">
- content
- </div>
- <?endwhile;
- endif;
- $argspagi = [];
- $argspagi = [
- 'prev_next' => true,
- 'prev_text' => __( '<i class="fa fa-long-arrow-left"></i>' ),
- 'next_text' => __( '<i class="fa fa-long-arrow-right"></i>' ),
- 'type' => 'plain',
- ];
- the_posts_pagination( $argspagi );
- wp_reset_query();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement