Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ?>
- <div id="main-content" class="container content-wrapper body-content">
- <?php
- if ( have_posts() ) {
- $post_count = wp_count_posts('project')->publish;
- $post_count = (int)$post_count;
- $total_pages = $post_count / 8;
- if($post_count % 8 != 0){
- $total_pages += 1;
- }
- ?>
- <h3 id="top-header"><?php echo __('Projects', 'rbscp'); ?></h3>
- <?php
- while(have_posts()) : the_post();
- get_template_part('blocks/archive', 'block');
- endwhile;
- ?>
- <!-- Add pagination -->
- <div class="pagination">
- <?php echo paginate_links( array(
- 'base' => str_replace( 999999999, '%#%', esc_url( get_pagenum_link( 999999999 ) ) ),
- 'total' => $total_pages,
- 'current' => max( 1, get_query_var( 'paged' ) ),
- 'format' => '?paged=%#%',
- 'show_all' => false,
- 'type' => 'plain',
- 'end_size' => 2,
- 'mid_size' => 1,
- 'prev_next' => true,
- 'prev_text' => sprintf( '<i class="fas fa-chevron-left"></i>'),
- 'next_text' => sprintf( '<i class="fas fa-chevron-right"></i>'),
- 'add_args' => false,
- 'add_fragment' => '',
- ) ); ?>
- </div>
- <?php
- } else {
- esc_html_e('Sorry, no Projects were found', 'rbscp');
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement