You can do like this,
$args = array(
'post_type' => 'tribe_events',
'post_per_page' => get_option('posts_per_page'),
's' => get_search_query()
);
$query = new WP_Query($args); // Use new keyword and you need to use WP_Query not Wp_Query
while($query->have_posts()): $query->the_post();
the_title();
endwhile;wp_reset_postdata();
I used this in search.php
file. Worked without any problem.
Related Posts:
- Search Custom Post Type Pages and Custom Fields in 2 Dropdowns?
- Exclude drafts in all() view of edit.php
- Pagination not working on Custom Page Template
- Search widget breaks when using multiple loops?
- Search query – exact post title match
- Blogroll – Different layout for first post
- How to start with post number x?
- Hiding Draft Post In Admin
- How to filter my search in post if contains a word in title, content or excerpt?
- Search results posts_orderby and ID
- Why does WordPress search returns same number of results for every search query?
- How Can I Always Display A Particular Post First Using WP_Query?
- What would causes search to return incorrect results?
- search form for custom fields
- Search results for ACF data
- Redirecting wordpress search query to archive page
- How to create custom search form function including post “tags”
- How to invoke a HTML custom button based on a HTML dropdownlist menu
- How to get value of a selected option from select tag and use it in WP_query to filter posts?
- The first post appears twice
- WordPress search for specific Post Type
- wp query custom orderby not custom field
- Customize search results to include custom posts and display in a specific template page
- How to show the posts list into a static page? Problems to use the loop into a static page
- How do I control the fallback query after the original query returned cero posts?
- How can i retrive the movies, trailers, news in a single page using search
- Custom Post Title as search term
- How edit footer copyright info? [closed]
- How do I get content of custom post type through post ID
- How to include a post type in the admin/backend?
- How can I show many posts an author has per week?
- Set terms in a custom post
- How do I use WP_Query to get a range of posts with custom fields that have numbers with letters in them?
- Ajax load more button in Recent posts widget
- Get posts of ONE taxonomy term of custom post type
- WordPress Custom Fields (Checkboxes with multiple values)
- WP_Query with ajax handler returns the same posts
- WP_Query orderby not working with meta_value_num and menu_order
- Why WP_Query(‘showposts=5’) shows only 1 post?
- Custom WP_Query with complex ‘post_status’ argument
- How can I sort posts by the date and a custom meta field?
- I want to display custom text widgets for each post in the sidebar?
- is there a way to show the the post title after the image?
- recent posts for different categories
- How to make number of blog posts a custom field?
- Display posts styled exactly like default posts
- WordPress blog or WordPress website
- How to make classes for posts?
- Using custom post template
- Custom Post Archive Page not working
- Search by post title and content in wp_query without order
- Print all the tags from a custom post type Please
- How do I correctly set up a WP-Query to only show upcoming event-posts?
- Display multiple custom taxonomy values on single custom post types page?
- Blog post per page setting conflicting with custom WP_Query?
- Change post order random through out the entire WordPress
- How to insert 2 args into 1 Wp_Query for a slideshow
- Adding custom fields to bbpress reply form
- How to exclude latest x posts from a paginated query?
- Move first half of posts to one parent page, second half to the other page
- Setup a custom dynamic post
- Adding buttons to Add New Post and Add New Page
- Anyway to grab author name and featured image in an embeded in inital array of posts outside of loop?
- How to verify wp user password by sql query in wp? [closed]
- Custom Post Type – Category Rewrite – Remove Rewrite from Sitemap
- Removing noindex posts from wp_query
- CPT archive redirects to single post
- WP Query – Posts Per Page not working in combination with category__in
- Show posts by a custom post author
- Ajaxify This Code
- Custom loop pagination links not working
- Prevent Delete Attachment by URL or When Submit
- Enable Comments Box On Custom Post Type
- Cutom wp_query for geolocation search, pagination not working
- wp-cli post create & media import issues
- How to return another post than requested
- How can i limit the number of posts created per category?
- Pausing and Resuming WP_Query results
- How to do set post permalinks using 6 digit random unique function?
- Getting Custom Post Loop to display in Bootstrap 3 column grid
- Select only post id and meta value with WP_Query
- Turn On Comments On Custom Post Types in Directory Theme
- WordPress custom Query for Posts in Category display posts multiple times
- Responsive images with custom image size
- Making a custom Pagination for multi page blog post
- Lost draft under all posts and drafts
- ERROR: Your feed is invalid (after update WP4.7) in custom types
- Get user categories with most posts in it
- Editing the default page to show all posts, rather than most recent ones
- Unable to restore from backup – how to obtain old blog posts?
- Posts and Attachments with “Published” status in Search
- Random ajax load only works with posts_per_page set to -1
- How to : pagination in 3 different custom loops on the same page
- Automatically add date to the auto generation of post slug
- Permission issue with custom post type – not added to menu – by plugin
- Duplicate Custom Post Type and Taxonomy Slug
- How could I change my Permalink from blog to custom structure? [closed]
- Remove Custom Post Type Slug and add Custom Taxonomy to Permalink Structure?
- Take a received feedback item, turn it into a post
- Getting value from get_post_custom