I am unable to add a pagination to divide my posts between pages and navigate between pages.
Presently all 20 posts I’ve hundreds directly. I wish to add a pagination to the underside of my Web page and think about posts by 5.
I’ve a customized submit sort that I outlined as Undertaking. I’ve 2 pages. Homepage and Journal. Homepage options the feed of my Undertaking submit sort and Journal options my common weblog posts. I need each of those pages to have pagination.
My present index.php which is my Homepage is as follows:
<?php get_header(); ?> <?php get_footer(); ?> <div class="portfolioBlock"> <?php $args = array('post_type' => 'undertaking','posts_per_page' => 20 ); $loop = new WP_Query( $args ); if( $loop->have_posts() ): whereas( $loop->have_posts() ): $loop->the_post(); get_template_part( 'content material', get_post_format() ); endwhile; endif; ?> </div>
My readings settings is as follows:
I’m curious if that is triggered due to my customized submit sorts, would recognize any assist or lead to assist me add a pagination to the web page.
When i attempted the Googled resolution paginate_links I did not get any hyperlinks.
I additionally tried previous_posts_link() and that offers me the hyperlinks and I can transfer between pages, however every web page reloads the identical 20 posts, with none diving it up.
Thanks rather a lot!