It’s because when you call query_posts
, you’re overwriting the original query with a new one, you have to get the original query and reset the things you want to change.
global $query_string;
$per_page = get_option( 'to_count_archives' );
query_posts( $query_string . '&posts_per_page=" . $per_page );
Related Posts:
- How To Modify The Loop in archives.php To Have 11 Posts Per Page and CSS Styling
- Different post slug based on archive
- Get posts from sites in Multisite?
- How to get category and archive title?
- Get rid of WordPress category, tag and author archives?
- Category archive by year with permalink support /category/YYYY
- get_categories for custom post type with a specific custom taxonomy attached
- 404 Error On Category and Tags Pages
- Force WordPress to Show Pages Instead of Category
- Decreasing the Memory Consumption of a WordPress Site?
- What’s the URL for a category archive?
- Sort posts by tags in category pages
- 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
- How to get the category of the post and link it to the archive (of the category)
- How to hide a specific category posts in my monthly archive?
- Optimal way to redirect home page to category archive?
- Display posts links from a category group by year
- Display list of Sub-Categories and the posts they contain, within one main Category
- Display only the latest post from multiple categories
- Sort category page with custom field
- How to create tabled index of posts in a certain category
- How would you create a “weekly” archive?
- Sticky Posts Not Sticking to Top of Category Archive
- Root level category, tag, author and archive pages to work
- Select category in custom query
- Display one latest post from multiple categories
- Category Specific Archive
- How to have Multiple Archives Widgets, one archive widget per category (in a different page)?
- Are Custom Taxonomy Templates Possible?
- “Sticky” posts for each category (archive.php)
- I want exclude the particular category in sidebar
- Return category slug / title from category ID
- How to filter archives both by category and tag?
- Remove Archive Headline and Archive Intro Text fields on category and tag archive pages in WordPress Admin with Genesis framework
- Display only posts from referred category on date archive page
- Using widget logic I want to show only a widget on the archive page if there are no posts
- What type of page should i use? static page or category page? and what’s the difference? [closed]
- Exclude category from loop not working
- Creating archive pages for children categories
- “NOT ONLY IN” taxonomy query operator?
- Display “add to cart” button on every listing in product category page?
- WordPress categories being called “archives” in google links. How to remove?
- conditional for sub category on archive page
- Sorting posts by season
- weekly archive for custom category
- WP_Query() returns null when results exist!
- WordPress subcategories return 404 in custom template
- How to remove category titles?
- Show archives by year from just one category
- Post count for category and tag
- Archives for each category on WP Multisite
- 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
- Category index featured image
- Archive.php filtered by pre-determined category
- how to query posts and auto assign category if post title has keyword
- Modify WordPress SQL Query to pull from within a category
- query order by category
- Category being displayed without base parmalink
- How to change category and year archive permalinks/rewrite rules?
- How can I define a custom archive for childs of a specific category?
- Get parrent category name
- Get link which associated with a specific category and tag
- Restoring default article pagination on archives – Removing custom limits
- Category archive rewrite rule to include category/subcategory?
- add_rewrite_endpoint returns 404 on archives
- Multiple category archive page
- Custom archive.php: retrieve right post categories?
- wp_dropdown_categories() scripts working erratically on sidebar
- Filtering out child category posts from parent category archive not working
- Yearly Archive for Categories with dropdown
- Category archives with monthly pagination
- Order by category titles
- Have parent category contain only one post?
- Customize category page for different custom taxonomies
- List posts in alphabetical order
- Randomly load categories with latest post
- Set colors depending on category
- How do I query_posts in cat=1 AND not in cat=2
- List all posts in a category with query_post() function
- query_post order desc
- Exclude a category from a query that includes its parent category
- Category archive is displaying all posts rather than the specific category
- Show the latest post from child category?
- Pagination on category.php and tag.php not working
- Problem with different query loops (and “main loop”) on category template page!
- query_posts not reading correct categories
- How to Remove a Title from All Category and Tags Page?
- Pagination for query_posts();
- Do not show sub categories in the loop on archive-product.php
- About title on a page
- why get_the_post_thumbnail( the_ID()) echos extra post id
- Posts from a category on homepage with category archieves page default css
- function query_posts disabling current_page_menu class
- display category list year wise in wordpress
- query_posts by category_name and custom taxonomy
- How to display post in custom file not in archive file?