search function

This support request was posted in Flatbase by devrium

Request ID #34448 In Progress
  • 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

    Hi,

    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.

    Hi 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

    Hello,

    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.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

Login to your Account

Welcome back! Please log in to your account by filling the fields below:

Forgot?

Not a member? Create a free account.

Create a Free Account

You're 27 seconds away from some awesome WordPress free stuff, benefits and more. Create a free account and have access to our free products, benefits and more!

Already have an account? Log in
Secure Server