Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
  • #178647

    I want to use the WooCommerce Predictive Search widget and search page with the Abundance theme. I can’t seem to find where exactly to place the following code in the header.php file:
    “<?php if(function_exists(‘woo_predictive_search_widget’)) woo_predictive_search_widget(); ?>”

    I did search the forum but what I found did not help me. Can you provide guidance on how to do this?

    Much appreciated,


    Hi tremblayly!

    Please edit header.php then place this at the very bottom:

    <?php echo "<div class='woopredictive-search'>" ?>
                <?php if(function_exists(‘woo_predictive_search_widget’)) woo_predictive_search_widget(); ?>
    			<?php echo "</div";

    You can add this on your custom.css or Quick CSS to position the search:

    .woopredictive-search {
    position: absolute;
    right: 0;
    top: 5px;



    Hi Ismael,

    After I copied and pasted the code at the bottom of the header.php just BEFORE the last php closing tag “?>” I get a blank screen when I go to my website.
    After I copied and pasted the code at the bottom of the header.php AFTER the last php closing tag “?>” I can access my website.OK but the search used is not the Woo Predictive Search.

    Am I doing something wrong?



    Hi Ismael,
    I had to remove the code from the header.php file because it messes up my shop/product pages very badly.
    I need to know how to make sure this won’t mess up my shop pages. Any help is appreciated.



    Please try update Ismael’s code and change it to following one

    echo "<div class='woopredictive-search'>";
                if(function_exists(‘woo_predictive_search_widget’)) woo_predictive_search_widget(); 
    			echo "</div";

    Best regards,


    Hi Yigit
    Thank you for that. My pages display correctly with that code, however the search seems to be using the theme search, not the Predictive Search.
    Can you help figure out what this would not work?
    Much appreciated

    Could not reach you by email……

    Hi Yigit,
    I had to remove the code again because, again, the display got screwed up.
    Any resolution to this issue yet?

    • This reply was modified 4 years ago by  tremblayly.
Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘Abundance theme and WooCommerce Predictive Search’ is closed to new replies.