I have the code below:
<?php $the_query = new WP_Query( 'posts_per_page=30&post_type=phcl' ); ?>
<?php while ($the_query -> have_posts()) : $the_query -> the_post(); ?>
<div class="col-xs-12 file">
<a href="<?php echo $file; ?>" class="file-title" target="_blank">
<i class="fa fa-angle-right" aria-hidden="true"></i>
<?php echo get_the_title(); ?>
</a>
<div class="file-description">
<?php the_content(); ?>
</div>
</div>
<?php endwhile; wp_reset_postdata(); ?>
I am trying to use paginate_links
Wordpress function but no matter where I put it, I can't make it work. Can someone help me with this?
Try the code below:
When querying a loop with new WP_Query set the 'total' parameter to the
max_num_pages
property of theWP_Query
object.Example of a custom query:
Example of
paginate_links
parameters adapted to the custom query above:For more reference please visit this link