The7 pagination in custom WP_Query
The7 pagination in custom WP_Query, just copy the code below and paste it in your functions.php.
dt_paginator( $query, array( 'class' => 'paginator no-ajax', 'ajaxing' => false ) );
[php]
Example:
[php]
$paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1;
$args = array( 'cat' => '8', 'posts_per_page' => 8, 'paged' => $paged );
$query = new WP_Query( $args );
if ( $query->have_posts() ) {
while ( $query->have_posts() ) {
$query->the_post();
echo '<h4>' . get_the_title() . '</h4>';
echo wpautop( get_the_excerpt() );
}
wp_reset_postdata();
} else {
echo "<p>no posts found</p>";
}
dt_paginator( $query, array( 'class' => 'paginator no-ajax', 'ajaxing' => false ) );

THANK YOU SO MUCH FOR THIS!
This works perfectly, even in 2020 with the theme version being 9.0.0.1
Keep up the great work!