• Resolved Daniel

    (@ddumondgmailcom)


    Hello,

    I would like to add text at the end of my search results (ie.: Can’t find what you’re looking for?).

    I copied search.php to my child theme and no matter what I do in there — the changes to do not reflect on the front end.

    Am I missing something here? Is there another place I should be adding this text?

    Thanks in advance.
    Cheers!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello @ddumondgmailcom,

    Searches for post_type=product redirect to the woocommerce/templates/archive-product template. You can click here to review that file to see which template hooks are available to you by default. You can override the template by copying it to yourtheme/woocommerce/archive-product.php.

    Without editing the template, here is a barebones snippet you can try to add basic text after the main loop when searching:

    function post_search_text() {
    	if(is_search()) echo("Didn't find what you were looking for? ...");
    }
    
    add_action("woocommerce_after_main_content", "post_search_text");

    I hope that helps!

    Thread Starter Daniel

    (@ddumondgmailcom)

    BRILLIANT!!! Thanks so much @lioneldaniel — that worked perfectly!!!

    This was a HUGE help!! I really appreciate you posting these 2 solutions!!

    You ROCK!! ????

    Hello @ddumondgmailcom,

    I’m so glad to hear that we were able to help, thanks for getting back to us that the solution worked for you. ??

    Cheers!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Storefront Search Template’ is closed to new replies.