Put the below code after the page_navi function called.
<script>
jQuery('.wp-pagenavi a').each(function() {
var url = jQuery( this ).attr('href');
var array = url.split('/');
var lastsegment = array[array.length-2];
jQuery( this ).attr('href', '<?php echo site_url(); ?>?paged='+lastsegment);
});
</script>
put page_slug <?php echo site_url(‘Page_slug’); ?> like this if pagination on other then home page.
Hi Janothemes,
Which file do I add the script?
In the template file at the bottom.
Thanks for the tip janothemes!
I hope there will be a fix soon.
not working for me, it still redirects to /page/2 and that shows the first page not the second…
I got the exact same problem. Since updating to WordPress 4.4.1 pagenavi doesn’t work anymore. When I click page 2/3/4/5 etc., it just kinda refreshes the homepage and stays on page 1.
Weird thing is: it does work when the ‘default’ permalinks is enabled. When you choose any other option for permalinks, it stops working.
Can we get some help or fix?
It is actually a wordpress bug, and is currently been fix in 4.4.2 version, you can see the issue here, you can also find a temporal patch while they release next version:
https://core.trac.wordpress.org/ticket/35344
Micheldenegri, you rock! Thank you so much, that was the solution!