paged
is correct unless you’re using pretty permalinks, however, if you’re just trying to alter posts per page for categories, you should be using the pre_get_posts
action, there’s no reason to use query_posts
in the template:
function wpa85791_category_posts_per_page( $query ) {
if ( $query->is_category() && $query->is_main_query() )
$query->set( 'posts_per_page', 2 );
}
add_action( 'pre_get_posts', 'wpa85791_category_posts_per_page' );
Related Posts:
- List all posts in a category with query_post() function
- Pagination on category.php and tag.php not working
- Problem with different query loops (and “main loop”) on category template page!
- Pagination for query_posts();
- Pagination does not work with query_posts()
- Showing one post from each category, paged?
- Get posts from sites in Multisite?
- How can I create a category landing page followed by pages of posts?
- How To Modify The Loop in archives.php To Have 11 Posts Per Page and CSS Styling
- Does the ‘cat’ argument in query_posts fetch posts from subcategories as well as the given ID?
- List posts by category exclude current post
- Show Previous/Next Posts navigation only inside the same category
- Show posts of one category only with Custom Taxonomy on single.php
- Pagination on child category returns 404
- Disable pagination only for specific category
- Display one latest post from multiple categories
- Archive pagination causing 404 with permalinks structure
- Show posts of category in a page
- Alphabetizing Posts in a Category Page?
- How to override Category rendering mechanism
- Force category-slug.php to show page, even if it doesn’t exist
- Why is this category page limiting the number of posts?
- Exclude category from loop not working
- “NOT ONLY IN” taxonomy query operator?
- Listing Parent, Child and GrandChild Categories and then the PostTitles on Page Template !
- Custom page for WooCommerce’s /product-category/
- Pagination Not Working on Category.php page
- Broken category pagination
- ?cat=-1 Indexed Versions Of Homepage
- Making a tourism information website [closed]
- Post count for category and tag
- How to query post like normal search would do. within search.php page
- Query Posts Exclude Entire Category
- Pagination for category slug returns 404 when page >= 2
- how to query posts and auto assign category if post title has keyword
- How do I call posts with a certain tag?
- Modify WordPress SQL Query to pull from within a category
- Pagination is not working properly in Product Category/Tag pages
- Paging not working in category.php
- How do I toggle pagination on/off in search results and category listings via a link?
- Custom post and category template pagination problem
- How to make the link to the category for a post go to corresponding page number in archive?
- display posts from specific category on a page , in thematic child theme?
- Order by category titles
- Have parent category contain only one post?
- Page display certain Category Posts
- List posts in alphabetical order
- Add a custom category page in WordPress.org
- Category template with pagination returns 404 on next pages
- Randomly load categories with latest post
- Set colors depending on category
- How to display numbered pages in a category
- query_post order desc
- Exclude a category from a query that includes its parent category
- WordPress alphabetical A-Z custom post type post result display
- How to show 1-5 of X Total Results
- Show the latest post from child category?
- Having problems with paging
- Posts from a category on homepage with category archieves page default css
- Home Page Template – Specific Category
- Custom Page Template Category loop not functioning correctly
- wordpress taxonomy query posts
- PHP dynamical conditional post display
- Posts of specific category on page and excluded from index.htm
- new WP_Query issues
- how can i hide category?
- Pagination breaks on child-categories, works fine on parent-category
- Pagination for a category
- Can I define multiple paginations on a single page?
- Conditional category query breaking?
- Displaying links to all posts of the same category on the post page
- Post not found when filtered by category ID
- Show posts from category specified using a custom field
- Add class to current post in query_post
- How do I remove pagination from just some Categories?
- Show the number of the post
- Add custom categories and subcategories and posts as custom pages
- pagination 404 error, same slug home and categories
- Pagination for custom categories template
- Remove WP Core canonical for category pagination
- Show alternative menu based on page template AND post category
- “Next posts” of a category do not call category.php
- How to display products with multiple conditions, product_id and category_id
- WordPress pagination based on category
- How to add Pagination to foreach loop to page
- WordPress pagination not working because of subcategory
- Query post only from categories that have subcategories
- Loop within category’s posts
- Own Custom Tags/Category page ( posts)
- Displaying posts by year
- Paginating a list of all posts collected by category titles
- Using pagination with multiple loops causes it to break
- How to have a category not show up in query post with page panigation?
- Dynamically Adding Category Specific Content To Specific Category & Subcategory Pages
- Why Pagination is not working on Category.php
- What defines a post as portfolio page content?
- Category pagination not working in category.php please help me
- Link to page in category
- wordpress category rewrite rule with pagination
- how to create a page that shows all of multiple category posts on a single page