Ok, so I think you could apply the codex example as is:
function search_filter($query) {
if ( !is_admin() && $query->is_main_query() ) {
if ($query->is_search) {
$query->set('post_type', array( 'post', 'actualizacion', 'notificacion' ) );
}
}
}
add_action('pre_get_posts','search_filter');
I think you were just missing the !is_admin()
check in there…
Hope this helps!
Related Posts:
- Set posts of a custom post type to be private by default?
- How can I add dropdown widget/box to admin post page?
- Limit Authors to their Own Posts on front-end excluding admins
- Multiple Content Block
- Notice: Undefined index: suppress_filters
- Shortcode not working with post counter
- Changing default ‘posts’ parameters with register_post_type_args
- Homepage’s content is dependent on the custom field values (set automatically), how do I get homepage to update without manually updating page?
- Allow users to create posts without logging in?
- How to assign classes to all elements?
- Showing custom post type categories in the menu
- WordPress notification if new post published
- Get post format
- Template code to split a post and print a custom field?
- Send post changes to set email addresses (not users or subscribers)
- Display author box on just certain category posts?
- redirect after submiting post for review
- What is the best way to set the post category (Custom Post Type) automatically based on the one of the tags assigned to the post?
- subtracting the current post form then whole loop, which is generating all CPT titles
- When post is Published, insert into custom table a number – custom post type
- Post that populates itself (almost) automatically using data from imported excel file
- How to mark posts as visited
- Featured image in custom post is being disabled
- How to make a non-public post on wordpress approval?
- How to use a custom post type archive as front page?
- How make get_next_post() return first post when viewing last one
- Date archives for custom post type
- modify all posts of a category to “no comments allowed”
- Getting a div content of a post in wordpress?
- How to show related posts by category or custom post type?
- ascending order custom post type
- add_meta_box: Datepicker like the one for postdate?
- Display taxonomy term only if there’s a value
- How to show post title outside of loop? [closed]
- How do you use JavaScript to detect the homepage
- Append taxonomy terms as class names in markup?
- How to delete all posts from a custom post type?
- Update content of multiple pages/posts at once?
- Display types of posts in edit.php instead of All, Published, Scheduled and Draft
- GravityForm: Populate Dropdown with custom post type [closed]
- Trying to edit the single page from a Custom Post
- How to Submit Post Via cURL & PHP
- apply filters only to specific post listing without check the url parameters
- How to retrieve category NAME instead of ID in a function with a taxonomy custom field?
- is there a way to retrieve posts that do not have a featured image assigned?
- WooCommerce product search titles only
- Custom Taxonomy Permalinks Redirection
- Add custom column in custom post type edit page
- Change CPT archive title
- I need to add endpoint for wordpress categories
- Hide a widget inside a div on specific type of post
- How to sort posts in a custom post type by title in ascending order by default?
- Warning: Invalid argument supplied for foreach() [closed]
- Custom post type isn’t working
- Conditional for a Single Post That Belongs to a Category?
- $post not working working in AJAX plugin with custom post type
- custom post for slider
- Multiple pages per post (not pagination)
- Variable not working in WP_Query
- What’s an efficient way to change the post status of many posts at once?
- How exclude or skip post type with get_next_post_link
- Prevent A Specific Custom Post Type Showing In WP Search Results Page
- Create short URL with auto 301 redirect
- How to handle new post from API request?
- Render a Post or Page using the correct file
- WordPress Count posts within a custom post type
- Copy/Move selected taxonomy terms to another taxonomy for posts
- Twitter Product Cards
- WordPress post carousel
- Custom post type tags not showing in search
- How to setup different permlalinks for posts and pages?
- Excerpt length: get first paragraph
- Title and URL Error in Breadcrumb Navigation for Custom Post Types
- Assigning categories to custom post types via a front-end form; only works for native post type
- Default excerpt for parent of a custom post type
- Move to trash custom post type post after ACF Date Picker date is older than today
- wp_post_delete is deleting all offices
- Why doesn’t wp_delete_post allow trashing for custom types?
- post type => ‘any’ not applied my custom queries
- Using get_post_type with a custom URL format?
- Using Orderby and meta_value to order natural/alphanumerical
- $_SESSION Not working after X amount of page views
- WordPress page not showing up – replaced with last 10 posts?
- WP_posts (Not meta) extra custom field column show and change it in a custom post type
- how to make custom post with “publish” default functionality not save in draft?
- Custom Field to post_title
- Most efficient way of showing children posts?
- Custom post type with two templates
- Post Custom & Taxonomy 404 error
- One Post with different content, depending on a Page
- How To Display Category list from Portfolio post type plugin?
- How to display data with pagaination on backend?
- Edit post meta direct from post.php?
- How to Arrange Support => Thumbnail
- Front-end form submission not creating post
- Allow authors to create article image
- show the most recent date of all posts to display on front end
- Comments are not working on Custom Post Type
- wordpress category form fields in popup
- How Do I Add a Custom Post Type URL to Content?