I am stuck having to use an older plugin, which is no longer maintained. The problem i'm facing is that in WordPress 5.5, the pagination that plugin uses, breaks. All you see is the first page.
This is the code for pagination it uses:
<?php
if ($data['total_pages'] > 1)
{
$add_args = $data['search'];
unset($add_args['paged’]);
echo '<p class="parariusoffice-pagination">' .
paginate_links(array(
'total' => $data['total_pages'],
'current' => $data['paged’],
// maybe include this: get_option('permalink_structure')
'base' => rtrim(get_page_link(get_the_ID()), '/') . '/%#%/',
'add_args' => $add_args
)) .
'</p>';
}
?>
<?php endif; ?>
I have found that changing the permalink structure in the WordPress settings has no effect on this error.
I found this information on permalinks: / , but I am unable to make it work.
How can I make pagination work in this plugin?
Edit: I have found that the main cause is that WordPress no longer allows paginated urls like: /aanbod-panden/2/?order=online_date%3Ddesc It was suggested here: to change the numeric values at the end of the url /aanbod-panden/2/ to /aanbod-panden/?2/
Any suggestions on how to accomplish that in the above plugin code are more than welcome!
I am stuck having to use an older plugin, which is no longer maintained. The problem i'm facing is that in WordPress 5.5, the pagination that plugin uses, breaks. All you see is the first page.
This is the code for pagination it uses:
<?php
if ($data['total_pages'] > 1)
{
$add_args = $data['search'];
unset($add_args['paged’]);
echo '<p class="parariusoffice-pagination">' .
paginate_links(array(
'total' => $data['total_pages'],
'current' => $data['paged’],
// maybe include this: get_option('permalink_structure')
'base' => rtrim(get_page_link(get_the_ID()), '/') . '/%#%/',
'add_args' => $add_args
)) .
'</p>';
}
?>
<?php endif; ?>
I have found that changing the permalink structure in the WordPress settings has no effect on this error.
I found this information on permalinks: https://developer.wordpress/reference/functions/paginate_links/ , but I am unable to make it work.
How can I make pagination work in this plugin?
Edit: I have found that the main cause is that WordPress no longer allows paginated urls like: /aanbod-panden/2/?order=online_date%3Ddesc It was suggested here: https://core.trac.wordpress/ticket/51001 to change the numeric values at the end of the url /aanbod-panden/2/ to /aanbod-panden/?2/
Any suggestions on how to accomplish that in the above plugin code are more than welcome!
Share Improve this question edited Aug 28, 2020 at 9:07 ErwinV asked Aug 24, 2020 at 10:31 ErwinVErwinV 213 bronze badges 3 |1 Answer
Reset to default 1I finally found a solution.
Disable the redirect canonical function with:
add_filter( 'redirect_canonical', '__return_false' );
And fix the 404 error that results from disabling the redirect canonical with this suggestion
$data['total_pages']
come from? I don't think WordPress sets it, even before 5.5. – Rup Commented Aug 24, 2020 at 10:42