Use this code instead for query post. Parameter ‘paged’ is which that keep track of the pagination so you have to pass it on query posts.
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args = array(
'cat' => 0,
'paged' => $paged
);
query_posts($args);
Also try to avoid query_posts()
unless its absolutely necessary. Use get_posts()
.
Related Posts:
- How to return results of a get_posts() in explicitly defined order
- Is it better practice to use query_posts, WP_Query, or get_posts to create various custom loops within a Page?
- how could I get the pagination as I want to when query posts using get_posts function
- Post count per (day/month/year) since blog began
- How to get 4 Posts after the 5 most recent ones
- making random query button using $_GET
- how to exclude “featured” posts from the main loop?
- Show Only Posts Owned By Logged In User + my post
- WordPress pagination with get_posts?
- get_the_title outputs title until spacing; it does not get full length of title
- WordPress query reverse order
- How to reverse post navigation at bottom of post
- Multiple posts/pages in one page?
- Posts being viewed
- Querying a query
- Trouble highlighting correct menu parent with wp_nav_menu classes while viewing “single posts”
- Pagination doesn’t work in query post in tag template
- allow user to edit posts made by others users based on the user role
- Post per page not working
- query_posts works while get_posts doesn’t
- query_post by title?
- How to get post content by calling ajax?
- Filtering posts by post meta data
- How to use the_posts_navigation for wp_query and get_posts?
- How to query_posts using meta_query to orderby meta_key AND have a secondary sort by date?
- Using WordPress to make a “Product Search” type navigation drilldown
- Help to condense/optimize some working code
- Modify main WordPress loop with a parse_query filter
- Problem with ‘post__not_in’
- Get posts by meta data OR title
- using post__in allow duplicate post id
- Retrieving 3 latest post from each of 5 different custom post types
- How to sort by meta value?
- pagination in author.php template returns 404 error
- query recent posts from several categories
- Example Query Posts Showing the Latest Post with the Featured Image
- Dynamically excluding current page id
- How do i paginate query_posts with numeric pagination?
- How to order results by date and meta key?
- Using query_posts inside single.php loop
- posts_per_page => 1 shows 2 posts
- Show individual author rank from query of cumulative post view count for all authors
- Custom posts per page does not work with pagination
- posts_per_page override by default settings
- How to paginate posts correctly that belong to a particular category and are random ordered
- How to filter query to display posts from parent category only?
- Display random post on a page with post permalink in URL
- Logged in user ID as post ID
- Why is querying posts messing up my pages?
- query_posts() on key’s value, or key’s existence
- ACF Query meta_values don’t work with ‘offset’
- How to display certain category in the loop from WordPress default post type?
- How to retrieve an array of post IDs by a particular value stored in a custom meta’s array
- Custom loops, sticky posts, and pagination nightmare
- Querying posts only if the current page is not paged?
- post_parent array doesn’t work
- how to store wordpress loop in array?
- meta_query check for meta value in key which holds an array of values
- Get all posts which was posted on X Days WordPress
- Exclude posts by post meta value
- Single-page wordpress theme navigation
- meta tag placement for google verification
- When to use WordPress loop or Foreach loop?
- Can’t get pagination to work for sticky posts only
- show x number of posts from y category on homepage
- How to Show Comment Count on Related Posts?
- Frontend form with multiple posts
- Way to cache a query for 24 hrs
- Make query_post category name dynamic
- How can I list posts with different formats depending on order?
- WordPress Query based on random taxonomy
- Displaying and Querying Posts with Featured image
- View Achive with Category Filter, but Page per post not working
- Meta query stopped working
- Sticky posts don’t show up first in custom loop
- Want Page Descendants when using query_posts post_parent or child_of
- grab neighboring content in a query
- the-events-calendar, pagination with tribe_get_events()
- Magazine style frontpage with multiple categories/loops and no duplicate posts
- How do I query based on the modified date?
- Is there any way of only retrieving posts with one or more thumbs up (GD star rating plugin)?
- Modify default Related Posts Code to Custom Post Type
- get_next_post() not working with future post status
- How to put orderby on a custom field in query_posts
- wp_remote_post and form post
- Filter posts by current date ( WP Post Carousel )
- Create a hierarchical loop at predefined markup requirements
- How can I add recent posts to menu like mashable
- Custom query posts error
- When should you use WP_Query vs query_posts() vs get_posts()?
- wp_query by last month + sort posts
- query_posts not working after wordpress 3.7 update
- Is that the query_posts() the real criminal here?
- Query specific posts from parent by slug rather ID
- query_posts and sub pages?
- How to refine WP-Query with further criteria
- Multiple loops with / without sticky posts and different post limits
- prevent display duplicate titles on main page
- Lots of SQL queries
- Limiting the amount of posts this displays