Home Forums WoodMart support forum Extend “Search” settings in header to include CPT and group results

Extend “Search” settings in header to include CPT and group results

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #597421

    markus
    Participant

    Hello,

    you have built a very cool search feature for products, however it does make sense to include more than products. For instance blog posts, or other custom post types like FAQs etc. could be included

    The first problem: you allow currently only all or a single choice. By default it’s set to include products only. I cannot select products and FAQs for instance but ignore pages.
    (in bold the post stypes)

    The second problem is the visualisation: products with product images show nicely in the results list. But what about posts without a featured image. One workaroudn is to modify the loop of the search result so that only the title is shown and nothing else (only then all posts are equal). Or it can be presented in groups, e.g. group of results for products, a group of results for FAQs or any other post type.

    Thanks
    Markus

    Attachments:
    You must be logged in to view attached files.
    #597477

    Hello,

    01. Unfortunately, there is no such option in Theme Settings to make the search post type to both products and posts.

    You can easily change the search post type as per your requirement by Navigate Woodmart >> Header builder >> Edit the header which you are using >> Edit the search form >> Select the post type for search.

    02.You need to edit the theme for this. Try to edit the file at your own risk.
    wp-content/themes/woodmart/inc/modules/search.php

    Best Regards.

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