Title: Need some PHP help&#8230;
Last modified: August 21, 2016

---

# Need some PHP help…

 *  [webstudent123](https://wordpress.org/support/users/webstudent123/)
 * (@webstudent123)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/need-some-php-help/)
 * Okay so I am trying to integrate a new woocommerce search plugin (‘predictive
   search for woocommerce’) and am mostly having issues with combining the PHP with
   html being echoed from php… if that makes any sense.
 * So here’s what I got from the plugin author: They say to put this code on your
   header.php file
 *     ```
       <?php
       $ps_echo = true ;
       if ( function_exists( 'woo_predictive_search_widget' ) ) woo_predictive_search_widget( $ps_echo );
       ?>
       ```
   
 * and to remove any existing search functions. I can do that and the search bar
   works, it just does not display where I want it. I want it within the menu to
   the left of the cart icon.
 * I have found in my header-models.php file where that code is pulled and have 
   attempted to integrate the php snippet into it somewhat like this:
 *     ```
       $header_return .= ‘
       <div id=”main-nav-bg” class=”nav-box”>
       <div class=”row”>
       <div class=”large-12 columns quasar-nav-fixed-ready”>
       ‘.quasar_get_nav_menu(false).’
   
       ‘.$ps_echo = true ;
       if ( function_exists( ‘woo_predictive_search_widget’ ) ) woo_predictive_search_widget( $ps_echo );’
   
       </div>
   
       </div><!– Clear any unwanted alignment from menu–>
       </div>
       <div class=”nav-shadow-container”>
       ‘.$menu_shadow.’
       </div>’;
       ```
   
 * My theme author suggests I directly replace the search function from the functions.
   php file, which creates the default search function, but I again am having no
   lucking integrating the new code into this:
 *     ```
       $search_icon = '
       <div class="special-search-container">
       <i class="fa fa-search"></i>
       <div class="special-search-overlay-box padding">
       <form role="search" method="get" id="searchform" class="searchform" action="'. home_url( '/' ).'">
       <div>
       <input type="text" value="" name="s" id="s" placeholder="'.__('Search for:','quasar').'">
       <input type="submit" class="button buttom-custom" id="searchsubmit" value="'.__('Search','quasar').'">
       </div>
       </form>
       </div>
       </div>
       ';
       ```
   
 * Obviously I am not much a programer so any help or advise here would be greatly
   appreciated.
 * In case it helps here is the site in question: [http://trautmantraining.com/](http://trautmantraining.com/)
   FYI the magnifying glass, slide out search bar is the one to be replaced. I will
   notify on this thread as soon as I get this figured out.

Viewing 1 replies (of 1 total)

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/need-some-php-help/#post-4685960)
 * > have attempted to integrate the php snippet into it somewhat like this:
 * in that code, replace all ‘weird’ single quotation marks ‘ and ’ with straight
   ones ‘
    (that can happen if you copy/paste from text sources)
 * unfortunately, you will need to contact your theme’s developer for support with
   your question.
 * this forum cannot help with commercial themes; [http://codex.wordpress.org/Forum_Welcome#Commercial_Products](http://codex.wordpress.org/Forum_Welcome#Commercial_Products)

Viewing 1 replies (of 1 total)

The topic ‘Need some PHP help…’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [Michael](https://wordpress.org/support/users/alchymyth/)
 * Last activity: [12 years, 3 months ago](https://wordpress.org/support/topic/need-some-php-help/#post-4685960)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
