Assuming removeCommonWords()
returns a string, you can do the following:
$zoekterm = removeCommonWords('motorkap met');
$query2 = new WP_Query(
array(
's' => $zoekterm
)
);
while( $query2->have_posts() ) {
$query2->the_post();
echo the_title() . '</br> ';
}
Sometimes the array notating is more useful than the string notation …
Related Posts:
- WP_Query by post ID doesn’t work if post is in custom post_status
- Order Search Results Page by meta_value If no Value Return Remaining Results
- Tracing the life of a query
- Query all posts where meta value is empty
- WP_Query orderby taxonomy term value (numeric)
- Finding all results from database within 500 miles of the given latitude and longitude [closed]
- How to get post meta value and post in one query?
- wp query by search in titles only & put the posts in loop
- Woocommerce custom loop to show all the products [closed]
- Pagination 404 errors for author posts query on author.php
- List the 5 most recent child pages
- Meta-value query
- Display link to taxonomy archive only if it has posts with certain custom field values
- WP_Query compare with dynamic values
- WP Rest API max limit include parameter?
- Adding multiple post queries with parent and children to page – Best Way
- Programmatically set ‘meta_query’ for filter
- WP Query Exclude and Start by Menu Order Offset
- Query total number of posts
- Category attribute not working in custom shortcode
- WP_Query Excluding pages with Order is 0
- Complex Orderby Parameters: How to query with multiple orderby parameters using meta_value_num?
- Show all post for a given category
- WP_Query create html structure
- How is WP_Query parsed to determine which template to request?
- pagination with numbers for WP_User_Query
- new WP_Query(), have_posts() return false in user_register hook
- How to filter, restrict and return posts based on custom user meta information
- Masonry, WP_Query & paged – first page repeating, second page not loading
- REST API: Limit Read Permissions for Default Endpoints
- Stuck in the query loop
- How to sort post by custom table value
- Filter wordpress post categories with jquery/ajax and pagination?
- Include current post into loop
- Is it safe to access the underlying mysqli object from \wpdb for custom queries?
- wp_query to print posts if have X custom field value
- How to display the featured image for each post?
- How do I amend wp_query before it is run/executed?
- Post Thumbnail URL isn’t pulling into the background of div
- Rewrite gets completely ignored
- Merge 2 custom post type posts and taxonomy terms and sort ascending
- Pagination on template page for custom query redirecting to index.php
- how to get Nearby zipcode
- Should $query-> be used with conditional tags?
- Exclude authors IDs from WP_Query
- Reload Query Loop When FacetWP Uncheck [closed]
- WP Query Compare cutting off last 2 dates
- How to combine two WP_Query objects?
- WP_Query author parameter not working
- How to order posts on each different category?
- Exec wp query in slow motion to avoid memory error?
- Wpdb->query result show 1 but is not an integer
- Loop 3 posts column wise and continue the loop into same columns
- Remove post type filter added by the plugin in the final query
- How to get more data of a post by wp_query
- Is it possible to retrieve posts depending on meta_key LIKE condition? [duplicate]
- WP_User_Query orderby meta_val_num
- Query Taxonomy By Page Title
- WP_Query custom order and pagination
- Why is the value zero going in my custom database table?
- function wp() does not use meta_query?
- Query Not working as expected
- Determine if ID is page or post and query the ID
- Widgets: Show Recent Posts Only if the Posts Have Both Categories X and Y
- Having a variable based on $post_count increase when i move to the next page of results
- Post order by custom fields
- WP Query and multiple pages
- How can I do a orderby by the number of items? So basically list by starting with the array with the largest number of post
- How to get all user posts from two post types in wp_query
- WP_Query for distinct meta values
- Group Product Types
- How do you do a meta query on an encrypted field?
- meta_query with meta values as serialize arrays
- pre_get_posts pagination not working
- Prevent Duplicate Post Counted by Query
- Multiple WP_Query args combinations according to post type
- wp_set_object_terms() custom taxonomy not working correctly when using insert post
- WP Query by variable custom field
- in_the_loop() issue with custom query
- How to restrict add media library only to images of the same post family?
- Is my code correct?
- TAG Query showing only 1 result
- Tax_Query not working – connecting to second wordpress database
- get_posts query caching?
- wp_query returns match with no criteria
- pre_get_posts with WP_Query to prevent posts from specific tags
- How can I modify standard search query to include also ACF custom fields values?
- Retrieving category pages from subcategory returns empty sets
- Archive – Show Page Month Headers
- Loop through multiple custom fields with increasing number
- Different number of posts showing in development vs production server
- Order WP_Query results in order other than ASC or DESC
- More efficient query to display posts in same sub-category?
- Get post closest to today
- query post based on comparison
- Pagination in custom query not working [duplicate]
- $query_args for loop to only get posts from “current category”?
- How to write a query-function as a query-shortcode?
- Query All Posts: Either Display Most Recent or One with Particular ACF Value Chosen
- Can I use WP_Query to find a post with a particular menu_order?