Change search to search site-wide and not only products

This topic has 4 replies, 3 voices, and was last updated 9 years, 5 months ago ago by Eva Kemp

  • Avatar: lionelkw
    lionelkw
    Participant
    July 8, 2015 at 16:02

    Hello,

    I’d like the search functionality integrated with the theme (especially the modal one) to not limit its search to products but look also into the blog articles – just like the regular WordPress search. How can that be done? (I am using https://searchwp.com/ which hijacks normal WordPress searches so I would like to just use the default WP behavior)

    Also, it seems there are not localization chains for “Use this form to find things you need” and “Type here…” in the modal search, they are missing in the .pot file (unless I’m mistaken).

    Thanks,

    3 Answers
    Avatar: Jack Richardson
    Jack Richardson
    Support staff
    July 9, 2015 at 07:45

    Hello,

    “Use this form to find things you need” text is present in .po file in wp-content/themes/classico/languages.
    “Type here…” is present in the file wp-content/themes/classico/woosearchform.php.
    To have posts available for search you need edit the file wp-content/themes/classico/woosearchform.php and comment the code <input type="hidden" name="post_type" value="product" /> in line 12.

    Best regards,
    Jack Richardson.

    Avatar: lionelkw
    lionelkw
    Participant
    July 9, 2015 at 08:53

    Thanks, it uses classical post search, but it is not hooking onto SearchWP. Could you point me to where the custom search queries are actually written in Classico? (I’ll take it from here, I won’t be asking you to rewrite that code!)
    Also, “Use this form to find things you need” is indeed present in the .po file, but any changes made to it do not reflect on the site… Possibly a bug.
    I will edit “Type here” but also, for a full localization, it should be present in the .mo file.

    Avatar: Eva
    Eva Kemp
    Support staff
    July 10, 2015 at 11:01

    Hello,

    You need edit the file wp-content/themes/classico/woosearchform.php to configure search results to your needs.
    We’ve taken the bug with translation into our account and we’ll fix it.
    Meanwhile you can translate “Use this form to find things you need” in the file wp-content/themes/classico/framework/theme-functions.php (line 631).

    Regards,
    Eva Kemp.

  • Viewing 4 results - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.Log in/Sign up

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.