Search only shows results when logged in
Search only shows results when logged in
Search only shows results when logged in
Get a custom post type’s taxonomy type term names displayed as checkboxes and filter
Search and filter terms of a custom post type only and display results
There is a stray > at the end of our code above, make sure that is a ?> instead of > Try another shortcode, something simple to verify it is not shortcodes in general. Clear you caching, clear permalinks by going to the permalinks page and clicking update. Check if the search plugin has caching … Read more
Rewrite URL custom search query
How can I change text on my SearchWP search results page, as this is not an editable page in WordPress?
For regular admin panel search you should include “is_admin()” to be true. For checking for specific post type you should check from $query->get(“post_type”) Can you try to use this code add_action(“pre_get_posts”, function ($query) { if ($query->is_main_query() && is_admin() && in_array($query->get(‘post_type’), array(‘company’))) { $s = get_search_query(); $meta_query = [ ‘relation’ => ‘OR’, [ ‘meta_key’ => ‘_company_inn’, … Read more
OK. I have changed $query->set(‘orderby’, ‘type’) function search_filter($query) { if ($query->is_search && !is_admin()) { $query->set(‘post_type’, array(‘post’,’forums’)); $query->set(‘category_name’, ‘my-zen’); $query->set(‘orderby’, ‘date’); $query->set(‘order’, ‘ASC’); } return $query; } add_filter(‘pre_get_posts’,’search_filter’); Now, I don’t have any Error critical, but it doesn’t work. What is wrong in my code?
Why is my site removing $_GET and hyphenating my search term?
How to make the search form in “Add media” search custom attachment fields?