Archived topic
Pagination Anchor
3 replies · Started by Fabien on April 4, 2020
Hi,
For my archives, I've created a custom template with static content above the loop. Is there a way to add an anchor to the pagination link (like https://domain.com/category/page/2#latest-articles) ?
Thanks a lot !
Hi there,
Dove into the core code a bit and found this filter: paginate_links
Not sure if it will work, but it's worth a shot:
add_filter( 'paginate_links', function( $links ) {
return $links . '#latest-article';
} );
Hi Tom,
the code works perfect for the numbers but not for "previous page" and "next page". I hope you can help me out.
best wishes
Hey!
This topic is a bit old. Can you open a new one and describe what you are trying to achieve?
Feel free to reference back to one as well.
Thanks!