php – Combine Content Egg Search form with WordPress and Woocommerce-ThrowExceptions

Exception or error:

How I can combine Content Egg Search form or make it search from WordPress posts and Woocommerce products as well.

What I want is

Content Egg + WordPress + Woocommerce Search form combined

Content Egg Search Form Here it is Content egg Search Form

<form role="search" method="get" class="search-form" action="<?php echo esc_attr(\ContentEgg\application\ProductSearchWidget::getSearchFormUri()); ?>">

      <input type="text" name="s" placeholder="Product search...">
      <input type="hidden" name="post_type" value="product" />

      <button type="submit">Search</button>


Woocommerce Search Form

<form role="search" method="get" class="woocommerce-product-search" action="<?php echo esc_url( home_url( '/'  ) ); ?>">
    <label class="screen-reader-text" for="s"><?php _e( 'Search for:', 'woocommerce' ); ?></label>
    <input type="search" class="search-field" placeholder="<?php echo esc_attr_x( 'Search Products&hellip;', 'placeholder', 'woocommerce' ); ?>" value="<?php echo get_search_query(); ?>" name="s" title="<?php echo esc_attr_x( 'Search for:', 'label', 'woocommerce' ); ?>" />
    <input type="submit" value="<?php echo esc_attr_x( 'Search', 'submit button', 'woocommerce' ); ?>" />
    <input type="hidden" name="post_type" value="product" />

WordPress Search Form

<form action="/" method="get">
    <label for="search">Search in <?php echo home_url( '/' ); ?></label>
    <input type="text" name="s" id="search" value="<?php the_search_query(); ?>" />
    <input type="image" alt="Search" src="<?php bloginfo( 'template_url' ); ?>/images/search.png" />

All of these three search form result displayed on diff. search result pages

Content Egg shows on


and I’m using code like – which works prefect

<?php echo do_shortcode('[content-egg module=Amazon template=grid]'); ?>

WooCommerce and WordPress uses diff. template as well.

Currently I’m using

How to solve:

Leave a Reply

Your email address will not be published. Required fields are marked *