How do I detect which page I'm on within a paginated post?

I'm using wp_link_pages() to paginate a post. I want to show something below the post content only on the first page of the post. Naturally I thought I'd use get_query_var('paged') to get the page number, but it returns 1 regardless of which page I'm on. I know I could parse out the URL manually to see which page I'm on, but there has to be a built in WordPress function for this.

Topic wp-link-pages pagination posts Wordpress

Category Web


The pagination query var on singular posts is page, not paged.

echo get_query_var( 'page' );

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.