It returns 10, because that is usually the default specified at your site “read” settings (IIRC) and is used obviously explicitly for the front end, but also as default for the number of posts returned by wp_query
. What you are looking for is the number_of_posts
(don’t trust me, check the docs) argument for the query.
Aside, not sure what is it you are trying to do, but using LIKE
will make your queries slow. Whatever you are trying to do, there must be a better way (unless this code will run only once, and then maybe performance is not an issue)
Related Posts:
- Broken? WP_Query and “attachment” as a post type
- Ignoring initial articles (like ‘a’, ‘an’ or ‘the’) when sorting queries?
- Is it possible to query all posts that don’t have an attachment?
- How to paginate wordpress [gallery] shortcode?
- Should I use Transients with W3 Total Cache APC Caching? [closed]
- Add indexing to meta_value in wp_postmeta
- How to get Page/Post Gallery attachment images in order they are set in backend using WP_Query()?
- Getting attachments by meta value
- Count the number of images uploded on the website
- How to paginate attachments in a secondary query as gallery?
- Get posts by menu ID
- Slow SQL_CALC_FOUND_ROWS Query
- How do I exclude all images from a wp_query?
- get images attached to post
- What is an efficient way to query based on post_meta?
- Get attached media only
- WP_Query Performance Issues with meta_query
- query attachments of parent page if attachments of current page are smaller than …
- Should close $wpdb via $wpdb->close()
- Get the post permalink within the loop but without additional DB query
- Filter WordPress posts by between parameter
- Retrieve featured image (thumbnail) url from multiple posts with one query
- wp_query for displaying attachments with a tag
- How To Get Some Data From WordPress Database Using WordPress $wpdb Query?
- Show selected images on top in Media Manager
- What’s faster? One big query, or several smaller ones?
- How can I query posts with newly uploaded images?
- How WordPress attaches its Featured Images with posts?
- Sorting By Custom Posts With Attachments
- Order by custom table and multiplication
- Attachment changing page’s permalink – $post not resetting?
- How to fetch only media that was already attached to a post/page?
- why update and delete query not worked in custom table?
- How to do meta_query for attachments?
- Get attachment by meta_key value
- How to show optimized list of posts with all their attachment images
- Where to put meta Keys
- How to implement a new row_count method in WordPress?
- querying data via $wpdb and get_row
- wp_Qwery works to slow
- Show all data in database table and make it into an interactive table
- No results found from a $wpdb->get_results() query when trying to join more than one meta key query
- database query with more than a couple meta hangs and doesn’t complete
- WP_Query Attachment adds additional attachment count and need to link attachment to post url
- How to access custom WordPress database tables
- Is it possible to query from external database? [duplicate]
- WP User Query with Custom Fields and Search Results
- List of ways to access WordPress database?
- Specify strict ‘order by’ in WordPress query
- How to set up hierarchical relationships without using plugins / meta query
- how to get Nearby zipcode
- Does WordPress have something like Drupal’s DB API?
- Using Transients
- Slow Query On Search
- how to write wordpress query for multiple metakeys checking?
- Wpdb->query result show 1 but is not an integer
- Storing an array of objects related to each user
- Retrieve data from wordpress db via input and put those result in dropdown
- Issue with data array format
- Ignore image urls in wp_query search
- WP_Query: attachment image in “full” size?
- How can I build a query that returns all attachments of a page and it’s children pages?
- get all images from the wordpress media library with link to the post they are associated with
- Why last row deleted when refresh page
- Query a database based on form input then output to another page [closed]
- wp query search multi terms
- How to get meta key list efficiently?
- How to get user avatar via WPDB
- How to restrict add media library only to images of the same post family?
- How to extend WP_query to a specific table?
- Fix wp_term_relationships slow query in get_posts
- Translating WP query into to SQL query
- how to get custom attachment url?
- update_post_meta performance in a loop woocommerce
- update_post_meta performance in a loop woocommerce
- WP_Term_Query->get_terms() very slow query for WordPress filter
- Separate by Category Post Type
- I removed the “wp_rm_logs” table and am constantly getting this error
- Track write actions to the database
- wp_get_attachment_image not to get the post_thumbnaill
- Include post_status check within $wpdb query
- wpdb get_results() returns only 2 rows
- Query All Attachments and Order by Parent Publish Date
- How To Query All Attachment Images Found In Post Galleries
- Website goes slow down after importing long database
- WP_Query always returning the last custom post
- option select form always deleting the sql query
- Optimising amount of calls to custom fields
- WP_Query for attachments without duplicating post_parent and displaying tagged image
- Using WP_Query to get attachment returns empty set
- Some images not being returned with wp_get_attachment_image
- Loop issues when creating custom query for media uploader
- 294 Queries on Mainpage of WordPress
- how to add limit records in wordpress query
- Custom WP_query in Jnews theme returns thousands of posts
- WP_Query by meta key not returning any posts
- SQL query into to WP query
- Give attachments an archive page, and exclude unattached ones
- on attachment.php, how to display previous and next attachment links that follow the same order as a custom WP Query
- Optimizing AJAX Query with Large Database