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?
- get_categories for custom post type with a specific custom taxonomy attached
- 404 Error On Category and Tags Pages
- What’s the URL for a category archive?
- Sort posts by tags in category pages
- List posts by category exclude current post
- Optimal way to redirect home page to category archive?
- Display only the latest post from multiple categories
- 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
- Are Custom Taxonomy Templates Possible?
- I want exclude the particular category in sidebar
- 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]
- Creating archive pages for children categories
- “NOT ONLY IN” taxonomy query operator?
- 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
- WordPress subcategories return 404 in custom template
- How to remove category titles?
- Checking for two categories in query_posts
- Query Posts Exclude Entire Category
- Category index featured image
- how to query posts and auto assign category if post title has keyword
- query order by category
- How to change category and year archive permalinks/rewrite rules?
- 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
- Randomly load categories with latest post
- How do I query_posts in cat=1 AND not in cat=2
- query_post order desc
- Category archive is displaying all posts rather than the specific category
- 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?
- 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
- Problem with multiple loops in wordpress theme
- Displaying year once in category.php [duplicate]
- Show Secondary Sidebar on Category pages (archive)
- Displaying a custom field in Category Archives
- wordpress taxonomy query posts
- how can i hide category?
- Exclude categories from postquery
- show only sub categories if available?
- Sort posts alphabetically by category/custom taxonomy, insert divider between different types
- Redirect Problems with Archive Page and GET variables
- exclude certain categories form archive widget
- List of post categories only associated to another custom taxonomy
- How do I make an array to get the category name, dynamically, in an archive template?
- How to prevent WordPress from redirecting single page to prefixed category archive with same name?
- Display all posts from specific category
- Meta Box: display single image on an archive-template
- Make category archives page in menu non-clickable
- Custom Category Archive Pages
- Assign a class to first element in category in loop
- How to get get_categories()’s ‘hide_empty’ argument to work with global year var in the archive template?
- How to display total views of all posts of one category?
- Create monthly archive for parent category
- How to count the number of monthly archive?
- Transfering static site to wordpress and retaining category by month paginations
- Conditional statements based on custom meta value in category archives
- date.php shows all posts. how to fix it?
- Search tag within category
- Paginate WordPress Category Pages
- How to have a category not show up in query post with page panigation?
- Query pages by category
- Determine the category that an archive-page is for
- Easiest way to display post archives in category-then-alphabetical order?
- How to show monthly archive posts?
- AZ Directory posts directory index
- Category archive page has two URLs even when default theme is active with no active plugins