Reciving Error 404 blog/page/2/
I can't seem to understand the issue here with my pagination? when visiting /blog/page/2 page goes to 404 page. Help me guys?
div class=row
?php
// $paged = get_query_var('paged') ? get_query_var('paged') : 1;
if (get_query_var('paged')) {
$paged = get_query_var('paged');
} elseif (get_query_var('page')) {
$paged = get_query_var('page');
} else {
$paged = 1;
}
$querys = new WP_Query(array(
'post_type' = 'blog',
'post_status' = 'publish',
'paged' = $paged
));
if ($querys-have_posts()) {
while ($querys-have_posts()) {
$querys-the_post(); ?
div class=col-lg-6 col-md-6
a href=?= the_permalink(); ?
div class=news-modal-wrap radius5
div class=new-img-wrap
?php if (has_post_thumbnail($post-ID)) : ?
?php $image = wp_get_attachment_image_src(get_post_thumbnail_id($post-ID), 'single-post-thumbnail'); ?
img src=?= $image[0] ? alt=
?php endif; ?
div
img src=?= bloginfo('template_directory') ?/assets/images/logo2.png class=logo2 alt=logo2
/div
/div
div class=p-4
?php
$categories = get_the_terms($post-ID, 'blog_taxonomy');
foreach ($categories as $category) { ?
p class=d-inline value-btn p-1 radius5 text-uppercase?= $category-name; ?/p
?php } ?
h5 class=mt-4
?php the_title(); ?
/h5
p class=my-4
?php $content = get_the_content();
$trimmed_content = wp_trim_words($content, 25); ?
?php echo $trimmed_content; ?
/p
div class=new-date d-flex
p?= get_the_date(); ?/p
/div
/div
/div
/a
/div
?php wp_reset_query();
}
} else { ?
No Posts Found Of This p class=d-inline value-btn p-1 radius5 text-uppercase?= $sector; ? Category/p
?php } ?
?= wp_pagenavi(array('query' = $querys)); ?
/div
Topic wp-query pagination 404-error Wordpress
Category Web