When you use the Content Egg, you can add each deals to the post. WordPress searches by titles of posts but what if you want to have such search form which can show results from affiliate networks directly (without creating posts for each deals). This is possible with Content Egg and Frontend Search function.
First of all, you need to create two things – a page with search form (or widget) and a page for results.
There are several ways to show the affiliate search form.
The first option is using a widget CE:Product search (find it in Appearance – Widget). It has the same styling as a standard wordpress widget. Just place a widget in a sidebar.
The second way is to use the Content Egg shortcode.
The shortcode will generate a standard wordpress search form and will send users to the special page with results from affiliate modules instead of the wordpress search page.
This shortcode has also the same design as the standard wordpress search form.
Next step which you need to do is setup the page for output results. For this, go to
Generaland add the output shortcode to the text area
Search page template.
I recommend to use there common shortcodes of the Content Egg.
To configure the search form create the
ce-product-searchform.phpfile in the directory root of your theme (or a child theme). Add and customize the form code:
<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...">
To configure the global page template with a search result you need to create the
ce-product-search.phpfile in the directory root of your theme (or a child theme). Use code like the code in your template of
To configure product-search in the URL search form use a filter that should return a new slug: