• Hi everyone,

    I’m about to start on a (WordPress) project for a client which will require a search engine that is able to search for posts/pages based on their categories.

    Although I have used WordPress for a few projects, I’ve never really delved into the search.php page enough to understand exactly what it is capable of. However, I’m wondering whether it is possible to customise this so that 1) you can have numerous search bars which index certain parts of the Web site and 2) you can allow the search bar to ONLY search the keywords based on the categories set up in WordPress.

    An example might make what I’m saying a little bit clearer:

    Imagine I have a site that promotes different events, and all of the different types of events have their own page. The events can be created using posts and then allocated to categories (e.g. Dancing events, music, corporate etc) using the WordPress backend.

    I decide to search ‘Dancing’ within the search bar

    How would I then go about creating a search bar which searches for all posts which match ‘Dancing’ based on their categories, rather than searching the ENTIRE site?

    How would I also be able to get it to display only the posts and not other areas of the site such as pages?

    And last but not least, is there a way to prioritise the search results? E.g. if I considered posts within a certain post-type to be more important than others, could i make sure that these posts are always displayed before any others?

    Looking forward to the replies,

    Thanks ??

  • The topic ‘Search bar for Post categories’ is closed to new replies.