Hi,
Thank you for contacting us and I'd be happy to assist.
There is no direct method/feature available to include page's anchor in the view's pagination links, but you can use the following workaround to achieve the same:
1. You'll note that the URL attribute "wpv_view_count" is available in the URL, whenever the view's pagination link is used for navigation.
The value of that URL attribute can be acquired through the "wpv-search-term" shortcode:
https://toolset.com/documentation/user-guides/views/views-shortcodes/#wpv-search-term
Example:
[wpv-search-term param="wpv_view_count"]
2. This shortcode can be used in conditional output block, to check whether the page was navigated through pagination link or not:
https://toolset.com/documentation/user-guides/views/conditional-html-output-in-views/using-shortcodes-in-conditions/
When the output of this shortcode will be empty, it would mean that the view's pagination is not used.
Example:
[wpv-conditional if="( '[wpv-search-term param="wpv_view_count"]' ne '' )"]
// show this content only when URL attribute 'wpv_view_count' has some value set
[/wpv-conditional]
3. Finally, you can include some custom script inside this conditional block, that scrolls to a specific ID or anchor on the page.
( ref: https://stackoverflow.com/a/18103556 )
Example:
[wpv-conditional if="( '[wpv-search-term param="wpv_view_count"]' ne '' )"]
<script>
jQuery(document).ready(function () {
// Handler for .ready() called.
jQuery('html, body').animate({
scrollTop: jQuery('#what').offset().top
}, 'slow');
});
</script>
[/wpv-conditional]
Note: You'll replace "what" with the actual target ID on your page and this block can be included anywhere in the view, other than the loop so that it doesn't repeat.
( screenshot: hidden link )
As a result, the script will only be included and thus execute, when the page is reloaded through the view's pagination link.
I hope this helps and for more personalized assistance around custom code, you can also consider hiring a professional from our list of recommended contractors:
https://toolset.com/contractors/
regards,
Waqar