search function
This support request was posted in Flatbase by devrium
- devrium October 8, 2017 at 9:25 pm
Hi thank you the theme.
I’d like to exclude ‘pages’ and keep only ‘article’ post_type in the result page of the search form located to the home page. How can I do that ?Juanfra Aldasoro October 9, 2017 at 1:32 pmHi,
Thank you for writing. I hope you are doing well.
The search results page is a default WordPress template and it uses the default WordPress functionality. Unfortunately, it is not related to the theme in terms of functionality.
However, you can change that by adding some code to your functions.php or by using a plugin. We’ve found a tutorial that you may find useful: http://www.wpbeginner.com/wp-tutorials/how-to-exclude-pages-from-wordpress-search-results/
Best,
Juan.devrium October 15, 2017 at 4:27 pmHi thank you but the script on the link you gave me do not work. Plus you created a special type of post named “article”‘ in your theme. I want the search function only return the “articles” please.
Juanfra Aldasoro October 16, 2017 at 1:58 pmHello,
Thank you for the follow-up.
Yes, the code I’ve sent you can be edited and change putting “article” instead of “post”. That code actually works.
Best,
Juan.
You must be logged in to reply to this topic.