my pagination code:
function tevent_pagination() {
// Allowed html
$allowed_html = [
"span" => [
"class" => []
],
"a" => [
"class" => [],
"href" => []
]
];
// What should be before the page number
$args = [
'before_page_number' => '<span>',
'after_page_number' => '</span>'
];
// Printing the pagination
printf("<nav class='pagination'>%s</nav>", wp_kses( paginate_links( $args ), $allowed_html ));}
pagination links are correctly displayed, even the content is perfectly display which I click pagination links. but when I click on links the .current class is not updating. I have tried many things but still this issue is not resolving.
2
Answers
This issue was resolved by writing wp_reset_query() at the top of the function.
You are not passing current page on the args.