Frontend Search
Last updated
Last updated
With Content Egg, you can add each deal as a separate post. WordPress searches by post titles, but if you want a search form that shows results from affiliate networks directly (without creating posts for each deal), you can use Content Egg's Frontend Search function.
You need to create two things: a page with the search form (or widget) and a page for displaying the results.
There are several ways to show the affiliate search form with Content Egg:
Using a Widget:
Find the widget CE: Product Search in Appearance – Widgets.
Place the widget in a sidebar. It will have the same styling as a standard WordPress widget.
Using a Shortcode:
Use the shortcode [content-egg-search-form]
.
This shortcode will generate a standard WordPress search form and direct users to a special page with results from affiliate modules instead of the default WordPress search page.
The shortcode design matches the standard WordPress search form.
Please note, some themes can extend the Content Egg search form. For example, Rehub offers additional shortcodes.
The next step is to set up the page for output results. To do this:
Go to Content Egg – Settings – General.
Add the output shortcode to the text area labeled Search page template.
I recommend using common shortcodes of Content Egg. For example:
To configure the search form, create a ce-product-searchform.php
file in the root directory of your theme (or child theme). Add and customize the form code:
To configure the global page template with a search result, create a ce-product-search.php
file in the root directory of your theme (or child theme). Use code similar to the code in your page.php
template.
To configure product-search
in the URL search form, use a filter that returns a new slug: