Get the current page URL (including pagination)

Is there a WP function to automatically get the correct URL of the current page?
Meaning if I just opened a single post, the function returns the same as get_permalink(), but if I’m on a paginated instance of a page (when paginating through the comments), the function returns the same as get_pagenum_link(get_query_var('paged')) would do.

How to show a single post on the front page but have normal paging?

I would like to have a single post on my front page (always the latest), but let normal paging work. So the front page has post 1, the next page should have post 2-11 (1-10 is fine too), then 12-21 or 11-20, and so on. I know I can change the number of posts depending on the context, but setting this to “1” on the homepage means the further pages also show only one post.

WP_Query Pagination on single-custom.php

What I am looking to do: Setup WP_Query pagination in a single-custom-post-type.php template file What I have done 1) Created a post type called “authors”. Each post within that post type is an individual author. 2) Standard edit post screen pages contain a dropdown which lists all posts (authors) from the authors custom post type. … Read more

Related posts by author pagination not working on the production site

The code that I’m using has adapted from this example and successfully tested on my localhost but when I pass the site to a live server, the pagination crashes with wordpress permalinks set (/% postname% /) and only works with the default wp permalinks (? p = 123).
The problem is that it doesn’t show me any 404 page, but it also doesn’t let me go to the second or third pages, or any other’s if they exist.