Read https://wordpress.org/support/topic/navigation-not-working-3?replies=3 (first and last reply)
if you are not sure contact your theme author, because likely is because you do not know how to integrate with your theme
Plugin Name: WP-PageNavi
Plugin URI: http://www.lesterchan.net/portfolio/programming.php
*/
function wp_pagenavi($before = ”, $after = ”, $prelabel = ”, $nxtlabel = ”, $pages_to_show = 5, $always_show = false) {
global $request, $posts_per_page, $wpdb, $paged, $totalpost_count;
if(empty($prelabel)) {
$prelabel = ‘«‘;
}
if(empty($nxtlabel)) {
$nxtlabel = ‘»‘;
}
$half_pages_to_show = round($pages_to_show/2);
if (!is_single()) {
if(is_tag()) {
preg_match(‘#FROM\s(.*)\sGROUP BY#siU’, $request, $matches);
} elseif (!is_category()) {
preg_match(‘#FROM\s(.*)\sORDER BY#siU’, $request, $matches);
} else {
preg_match(‘#FROM\s(.*)\sGROUP BY#siU’, $request, $matches);
}
$fromwhere = $matches[1];
$numposts = $wpdb->get_var(“SELECT COUNT(DISTINCT ID) FROM $fromwhere”);
}
if($totalpost_count>0)
{
$numposts = $totalpost_count;
}
$max_page = ceil($numposts /$posts_per_page);
if(empty($paged)) {
$paged = 1;
}
if($max_page > 1 || $always_show) {
echo “$before <div class=’Navi’>”;
if ($paged >= ($pages_to_show-1)) {
echo ‘‘.__(‘« fillimi’).’‘;
}
previous_posts_link($prelabel);
for($i = $paged – $half_pages_to_show; $i <= $paged + $half_pages_to_show; $i++) {
if ($i >= 1 && $i <= $max_page) {
if($i == $paged) {
echo “<strong class=’on’>$i”;
} else {
echo ‘ ‘.$i.’ ‘;
}
}
}
next_posts_link($nxtlabel, $max_page);
if (($paged+$half_pages_to_show) < ($max_page)) {
echo ‘‘.__(‘fundi »’).’‘;
}
echo “</div> $after”;
}
}
what changes should i make in this code