• Resolved samscs

    (@samscs)


    Hello! I’m using the WP RSS Aggregator plugin and client is complaining that when the pagination links are clicked the browser is jumping to the top of the page (as you’d expect with the page being refreshed). Is there way to get around this? Some way maybe to add #whatever to the href of the pagination links?

    https://www.ads-software.com/plugins/wp-rss-aggregator/

Viewing 1 replies (of 1 total)
  • Thread Starter samscs

    (@samscs)

    If anyone else runs into this, here’s a (horrible) solution if you can’t find something better – add to <head>:

    <script>
    	function fix_news_links() {
    		var prev = document.getElementsByClassName('nav-previous');
    		var next = document.getElementsByClassName('nav-next');
    		var new_prev = prev[0].innerHTML.replace('">','#news-feed">');
    		var new_next = next[0].innerHTML.replace('">','#news-feed">');
    		prev[0].innerHTML = new_prev;
    		next[0].innerHTML = new_next;
    	}
    </script>

    And then add onload=”fix_news_links();” into the <body> tag. Make sure your news feed is in div#news-feed or adjust accordingly. About as elegant as a rhino’s fart but it does the job.

Viewing 1 replies (of 1 total)
  • The topic ‘Retaining scroll position with pagination links’ is closed to new replies.