My problem is that, although the links do appear on the bottom of the page where I place the function that calls the pagination.
when clicked, the page does nothing.
I’ve found countless similar questions on the web (many here on SO ) but when I try to implement
those posts resolutions, the same thing happens. ALL the different pagination methods,loops,functions….and EVEN plugins that I try WORK in that they appear on the page but when clicked, the URL changes accordingly but the page content doesn’t change.
So as an example, I’m using this loop that I found in an “accepted answer” from someone elses question here on SO
function pagination($pages = '', $range = 3){
$showitems = ($range * 2)+1;
global $paged; if(empty($paged)) $paged = 1;
if($pages == '') {
global $wp_query; $pages = $wp_query->max_num_pages; if(!$pages)
{ $pages = 1; }
}
if(1 != $pages) { echo "<div class='pagination'><span>Page ".$paged." of ".$pages."</span>";
if($paged > 2 && $paged > $range+1 && $showitems < $pages) {
echo "<a href='".get_pagenum_link(1)."'>« First</a>";
}
if($paged > 1 && $showitems < $pages) {
echo "<a href='".get_pagenum_link($paged - 1)."'>‹ Previous</a>";
}
for ($i=1; $i <= $pages; $i++){
if (1 != $pages &&( !($i >= $paged+$range+1 || $i <= $paged-$range-1) || $pages <= $showitems )){
echo ($paged == $i)? "<span class='current'>".$i."</span>":"<a href='".get_pagenum_link($i)."' class='inactive'>".$i."</a>";
}
}
if ($paged < $pages && $showitems < $pages) echo "<a href='".get_pagenum_link($paged + 1)."'>Next ›</a>";
if ($paged < $pages-1 && $paged+$range-1 < $pages && $showitems < $pages) echo "<a href='".get_pagenum_link($pages)."'>Last »</a>";
echo "</div>n"; }
}
and applied the function call to the bottom of my post loop under the endwhile//if so that it doesn’t repeat through each post shown on the page, and again, it shows (just like all the others)
but the page itself doesn’t do anything.
My question is, with this type of a problem where the links are showing up and all types of different versions I’ve tried, do appear on the page but when clicked, go nowhere, what is it I could be missing?
Do I need to enable pagination somewhere like the way one enables widgets or..or do my pages have to have any type of hook or ….. like when one inserts “” etc…
I’m at a loss.
This should solve your problem. Also I am using kriesi pagination function but you can switch out the if (function_exists(“pagination”)) with the default wordpress older and newer function.