Skip to content

Instantly share code, notes, and snippets.

@genesis16
Created April 27, 2022 05:13
Show Gist options
  • Save genesis16/86695c5ad0be1d8066f91f5b21502e76 to your computer and use it in GitHub Desktop.
Save genesis16/86695c5ad0be1d8066f91f5b21502e76 to your computer and use it in GitHub Desktop.
// for practical purposes I have called this template archive-template
but if your custom post type category is moves you would call this archive-movies.php.
I have set the posts to 9, but you can set it to however many you want.
$paged = ( get_query_var('paged')) ? get_query_var('paged') : 1;
$args = array(
'post_type' => 'insight',
'post_status' => 'publish',
'posts_per_page' => 9,
'paged' => $paged,
'order' => 'DESC',
);
// after your loop/endif statement, call in the pagination function using a div class of pagination
<div class="pagination"><?php pagination('»', '«'); ?></div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment