[Resolved] How to make search results page only for products & how to display products?

Home Forums Support [Resolved] How to make search results page only for products & how to display products?

Home Forums Support How to make search results page only for products & how to display products?

  • This topic has 5 replies, 3 voices, and was last updated 2 years ago by Leo.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #2146999
    Jin

    Hi I have two things that I’d like to do:

    1. Have the search results page only show products. I don’t want to it to show any posts or pages.

    2. Display products which match the query in a format that you see in the Shop page. (i.e. The product list component)

    #2147055
    David
    Staff
    Customer Support

    Hi there,

    for the best results i would recommend using a dedicate Woocommerce Search plugin like:

    https://wordpress.org/plugins/advanced-woo-search/

    #2148376
    Jin

    Hi David I’ve installed the plugin but the search results page still looks the same.

    In the docs, step 3 states to place the shortcode “into your template or post-page or just use build-in widget”. What does this mean for generatepress’ theme?

    #2148706
    Leo
    Staff
    Customer Support

    Maybe let’s try without the plugin first.

    You can use the snippet to make GP’s navigation search to only search for post type product:
    https://docs.generatepress.com/article/generate_navigation_search_output/#woocommerce-products

    Can you give that a shot first?

    #2149257
    Jin

    HI Leo

    It works perfectly. Thanks.

    #2149865
    Leo
    Staff
    Customer Support

    No problem 🙂

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.