You need to either add global $wp_query;
global $wp_query;
$page_test = $wp_query->get( 'paged' );
or use get_query_var();
$page_test = (get_query_var('paged')) ? get_query_var('paged') : 1;
Related Posts:
- how to know if the post has pagination () or not
- Duplicating Table of Contents for Paginated Post
- Change Posts per page count
- The next_posts_link() works only with original $wp_query
- Allow variable amount of comments before pagination
- Skipping first 3 posts in wp query
- How to load paginated post pages via ajax
- How to disable content pagination?
- How to Group Posts by the First Letter or Number?
- How can I display 7 posts on the home page, but 9 posts on the subsequent pages?
- Custom Post Type Pagination Doesn’t Work in WordPress 3.4
- Automatically create pages in a post based on number of words
- Show number of posts AND number on current page
- Pagination for Pages and Posts
- Programmatically inserting page breaks
- I’m having some issues with previous_post_link() and next_post_link()
- Pagination – Posting First Page Content
- Load posts into sidebar and paginate via ajax?
- How can I get all posts data from within a paginated search result?
- When paginating a Page with the tag, how can the 2nd and subsequent page styles be customised?
- Converting multiple loops into one single loop with pagination
- pagination hook doesn’t work with search results
- Unwanted Duplicate Posts Showing in Pagination Pages
- posts_nav_link() not displaying anything
- Is it possible to change the admin posts per page view?
- Lazy Load using WP_Query pagination
- Check to see if specific loop has less than certain amount of posts
- Pagination on single post page?
- If Specific Post, Link Elsewhere
- Should $found_posts be returned as string in ‘found_posts’ filter hook?
- Archive Page for Custom Post Type is not Working
- How do I detect which page I’m on within a paginated post?
- How to add pagination in between post and comments?
- 404 on paginated blog pages
- Blog post per page setting conflicting with custom WP_Query?
- Get the number of posts shown in the current page
- Blog page pagination is not working after using the offset argument
- Custom loop pagination links not working
- How to Restrict Previous & Next Post Link to Posts of Same Category?
- Making a custom Pagination for multi page blog post
- 301 (static page instead latest posts)
- Pagination with an array of post objects?
- How safe is renovating $wp_query when doing WP_Query pagination in Page Template
- Start WP Pagination From Number 1 in URL
- Use two different post_per_page limits with infinite scroll
- Conditionals if tags exist?
- using is_paged for hiding image on posts
- Total number of posts in query (category/tag/author/search results/main page…)
- Only show featured image on first page of paginated posts
- Getting blog pagination to work on page set as front page
- Change the number of excerpts displayed in search results layout
- WordPress pagination and Post Navigation not working on home page
- Banner appearing on Pages but not Posts; call it conditional confusion
- Pagination for normal (standard) posts on a page with a custom loop?
- Pagination for posts inside a specific category
- Rest API Paginate until all posts are imported
- Blog Posts – Scroll to view more
- Pagination not give another posts
- Manipulated offset and pagination, can’t display last post anymore
- Blog posts pagination not working
- Search results with pagination not working
- Go back to the exact post page number
- Pagination Not Working With Custom Post Type Category
- Pagination Stops
- Numbered Pagination Showing The Same Posts After Altering WP_Query
- Remove pagination if search returns empty
- Show code only on WooCommerce Pages
- Disable pagination in posts and pages
- Pagination (on the static front page) shows always the same posts
- Code to display random ordered posts in Categories across pages [duplicate]
- Count posts for pagination
- Override wp_link_pages pagebreak with filter
- Can I Paginate Post after every 25 tag?
- Pagination for single post
- Posts are not showing up on next page.
- Output wp_link_pages as raw url
- Admin is showing all posts on page 1
- Custom Select Query pagination not working properly
- Thumbnail With Next/Prev Links Not Showing Next Post?
- wordpress paginate, link to the right page
- Pagination working locally but not on live site
- Pagination and Related Posts
- Pagination for custom query won’t let me back on page 1
- Make a paginated article (for easier reading on mobile)
- how to show posts on different pages if number of post per page is one
- Can’t get pagination to work
- How to display a paginated list of posts from one category on a page? [duplicate]
- How to inject a post within a loop
- The next_posts_link() works only with original $wp_query
- how to add pagination to the organize series plugin
- Custom Post Type Pagination 404 Error (if paged>=2) [duplicate]
- Not displaying any articles on a custom made file
- WordPress posts loop pagination – first page return 125 posts instead of 10 and the rest return 10
- Issue with wordpress pagination: last 2 posts show again on second page
- Limit amount of pages shown in pagination within wp_query
- How to get pagination working with “Pending” Posts
- Page not found after clicking on pagination
- Single post pagination
- WordPress Custom Theme: My site shows the same posts on Page 1 and Page 2 and so on [duplicate]
- Show a page counter for pagination