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?
- Display posts from the same category using next/previous post link
- 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
- Display all posts from specific categories on a page
- Display all posts from all categories with pagination
- Listing Category ‘child_of’ by slug rather than ID
- Using categories & “stickyness” together
- 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
- Display only the latest post from multiple categories
- Page navigation within a 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
- Select category in custom query
- Display one latest post from multiple categories
- Archive pagination causing 404 with permalinks structure
- Custom category template pagination problem
- How can i call an article from each category and still paginate properly?
- Show posts of category in a page
- Return category slug / title from category ID
- 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
- 3 Columns, 3 Categories, One Archive, and Pagination
- Broken category pagination
- ?cat=-1 Indexed Versions Of Homepage
- Five posts from a category in footer
- Making a tourism information website [closed]
- Post count for category and tag
- Checking for two categories in query_posts
- 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
- query order by category
- Pagination not visible on woocommerce’s category page
- Pagination is not working properly in Product Category/Tag pages
- Get link which associated with a specific category and tag
- Restoring default article pagination on archives – Removing custom limits
- The default code for “posts_nav_link” on category.php isn’t working
- Why category.php throw 404 in wordpress while calling paginate_links()?
- Category with post type pagination returns 404
- Paging not working in category.php
- How do I toggle pagination on/off in search results and category listings via a link?
- Multiple Loops on category.php with pagination on last loop
- 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?
- Category archives with monthly pagination
- display posts from specific category on a page , in thematic child theme?
- category pagination got broken suddenly
- Order by category titles
- Have parent category contain only one post?
- Page display certain Category Posts
- Pagination for ajax category filter
- 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 do I query_posts in cat=1 AND not in cat=2
- 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?
- How to do paging in the loop?
- query_posts not reading correct categories
- Having problems with paging
- Posts from a category on homepage with category archieves page default css
- function query_posts disabling current_page_menu class
- Home Page Template – Specific Category
- query_posts by category_name and custom taxonomy
- Template for product-category page [closed]
- Pagination doesn’t work on multiple categories
- 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
- How to differentiate the homepage structure from the category page structure in WordPress template?
- new WP_Query issues
- how can i hide category?
- Pagination breaks on child-categories, works fine on parent-category