Creating a Back button on detail post page to go back to blog page with same query strings and page id
So, I would like to have a back button on the single post page that can be dynamic to the point to where it knows where it is in the query and bring me back to the blog page on the right page number and category and search query string. For example -> "localhost/news-blogs/page/3/?s=newsnb-cat=16" Now I can do this wp_get_referer() If was to stay on that page, but if I click on the next post link then it would just bring me back to the last page since wp_get_referer() fn just hold the last page history and if I was to keep clicking next post link it would need to know to change the page #, so when I clicked back it would bring me back to the page with that post exists.