Getting paginated pages information from a Wordpress post -
I & lt ;! - nextpage - & gt; I'm separating long posts using
, but need only for output user comments on the last page of a post. I can not find a way to calculate the number of pages endorsed and then page == if the output is final page.
Any help is appreciated
you $ wp_query - & gt; Can check with query_arrow ['page']
. On the first page, this value will not be present, while the latter pages will be set with the current page number.
$ currentPage = isset ($ wp_query- & gt; query_vars ['page'])? (Int) $ wp_query- & gt; Query_vars ['page']: 1;
Comments
Post a Comment