trumpetdev
Forum Replies Created
Viewing 2 replies - 1 through 2 (of 2 total)
-
So far THIS has helped me! Guess it wasn’t the plugin after alL! Thank you.
<section class="aggregate" id="cocktails"> <div class="aggregate__container--wrapper"> <?php $args = array( 'post_type' => 'cocktails', 'posts_per_page' => 8, 'paged' => get_query_var('paged'), 'post_status' => 'publish', ); $the_query = new WP_Query($args); ?> <?php if ($the_query->have_posts()) : while ($the_query->have_posts()) : $the_query->the_post(); ?> <?php get_template_part('global-templates/cocktail'); ?> <?php endwhile; ?> </div> <div class="pagination"> <?php $total_pages = $the_query->max_num_pages; if ($total_pages > 1) { $current_page = max(1, get_query_var('paged')); echo paginate_links(array( 'base' => get_pagenum_link(1) . '%_%', 'format' => '/page/%#%', 'current' => $current_page, 'total' => $total_pages, 'prev_text' => __('<'), 'next_text' => __('>'), )); } else ; ?><?php endif; ?> <?php wp_reset_postdata(); ?> </div> </section>
Viewing 2 replies - 1 through 2 (of 2 total)