The quick and dirty way to do it would be to use query_posts
again, doubling the number of database calls.
<?php if (have_posts()) : ?>
<?php query_posts('showposts=999'); ?>
Better would be to add this to functions.php
, altering the original query before it is executed:
function change_wp_search_size($query) {
if ( $query->is_search ) // Make sure it is a search page
$query->query_vars['posts_per_page'] = 10; // Change 10 to the number of posts you would like to show
return $query; // Return our modified query variables
}
add_filter('pre_get_posts', 'change_wp_search_size'); // Hook our custom function onto the request filter
If you want to show an unlimited amount of posts, use -1
.
Related Posts:
- Get page ID of page that is set as the posts page
- Including categories in search results
- Search Custom Post Type Pages and Custom Fields in 2 Dropdowns?
- Add “Post Options” for new wordpress post
- Search posts by post author name
- Search not working with title and content
- how to hide specific post from google search
- Add a custom option to a page in backend
- How to search only by post title and category?
- Search widget breaks when using multiple loops?
- Pagination not working on custom query
- How can I get all posts data from within a paginated search result?
- Search query – exact post title match
- pagination hook doesn’t work with search results
- Search for posts based on their url in the admin?
- How to activate Markdown in a local installation of WordPress 4.3?
- wp_query ‘s’ parameter does not work with custom post type
- Differentiate between posts and pages in search results
- Count search results in heading
- Private Posts/Pages & Search
- How to find what index page a post is on?
- Display number of posts via adress bar?
- Tags to Post-ID mysql query. Tag Search
- Define a wordpress constant through plugin functions?
- How to change wordpress dates to native language (even if the languge not available i wordpress)
- How to change the setting so there is no post on home page
- How do I get blog posts to appear within CMS?
- Display post option on frontend
- How to filter my search in post if contains a word in title, content or excerpt?
- Search results posts_orderby and ID
- Posts and Attachments with “Published” status in Search
- Set Default Category to Username
- How do I change the core post search algorithm? Where is it found/constructed?
- How to add add more properties to WP_Post object in search results loop
- Total number of posts in query (category/tag/author/search results/main page…)
- See if a post has a specified tag
- Update field in database for users
- Why does WordPress search returns same number of results for every search query?
- Dark Bar at the top of wordpress page can’t be seen?
- Hide parts of the post content after typing it’s name or searching it by category
- search content of pages and list in wp-admin
- How to exclude the word “class” from being matched in search?
- Will multiple category descriptions effect my search engine optimization?
- What would causes search to return incorrect results?
- I want to add another search box on posts page in dashboard
- Post page overwrite the custom blog page
- Showing Posts if non are found
- search form for custom fields
- How to show posts in grid style on search result page?
- Search results with pagination not working
- blog post not accesible on click [closed]
- How to show only homepage in google results instead of privacy, contact pages
- Redirecting wordpress search query to archive page
- How to search through “post title” and “tags” using WP_Query?
- How to create custom search form function including post “tags”
- Remove pagination if search returns empty
- How do i search post by jquery datepicker?
- How to get value of a selected option from select tag and use it in WP_query to filter posts?
- show only one category and filter by tag
- On WordPress Search, how to search post from Author meta also
- How to hide meta from search result only on pages?
- Category URL to use same string as Post URL Permalink
- Post being duplicated with foreach loop
- Showing get_option( ‘page_for_posts’ ) or View all posts link is not working in wordpress
- Find post tags words in post content and link them to tag URLs
- Custom author search
- WordPress search for specific Post Type
- Display result of custom form
- Customize search results to include custom posts and display in a specific template page
- How can i retrive the movies, trailers, news in a single page using search
- Custom Post Title as search term
- Related posts by searching post tags of single post as terms
- How to get only post=’product’
- Search doesn’t display posts with images
- Get WordPress post content by post id
- Get Posts Under Custom Taxonomy
- How to limit the number of posts that WP_Query gets?
- Stop WordPress Wrapping Images In A “P” Tag
- When is the ‘post_content_filtered’ column in database cleared by WordPress?
- Turn a URL into an Attachment / Post ID
- GET the excerpt by ID
- Stop WordPress automatically adding tags to post content
- Determine if page is the Posts Page
- How to get ‘post_content’ without stripping tags?
- How to add an admin notice upon post save/update
- Print Current Post Index number within Loop
- Should we trust the post globals?
- Optimize post insert and delete for bulk operations?
- Get the Current Page Number
- How do you add thumbnail support for custom post types?
- How to mark every 3rd post
- Change Posts per page count
- Keep featured content post in homepage with original order
- How to display related posts from same category?
- Can posts have parents?
- Is there a action hook for the “Empty Trash” button?
- How to end the excerpt with a sentence rather than a word?
- How do I check if I linked to a post before I delete it?
- How to change the case of all post titles to “Title Case”
- Appending content with broken in 4.4