Content Egg Pro Plugin
Pricing
  • Content Egg WP Plugin
  • Getting started
    • Installation
    • Upgrade Free to Pro
    • Automatic updates
  • Modules
    • General information
    • Affiliate modules
      • Aliexpress module
      • Amazon module
      • Amazon No API module
      • Avantlink Products module
      • Awin module
      • Bestbuy module
      • Bolcom module
      • CityAds Products module
      • CJ Products module
      • Daisycon module
      • Ebay module
      • Envato module
      • Flipkart module
      • GdeSlon module
      • Impactradius module
      • Kelkoo module
      • Kieskeurignl module
      • Rakuten Linkshare module
      • Linkwise module
      • Lomadee Products module
      • Offer module
      • Optimisemedia module
      • Shareasale module
      • Shopee module
      • Tradedoubler Products module
      • Tradetracker Products module
      • Trovaprezzi
      • Udemy module (deprecated)
      • Sovrn (Viglink) module
      • Walmart module
      • Webgains module
    • Coupon modules
      • Admitad Coupons module
      • CJ Links module
      • Coupon module
      • Lomadee Coupons module
      • Skimlinks Coupons module
      • Tradedoubler Coupons module
      • Tradetracker Coupons module
    • Content modules
      • Bing Images module
      • Flickr module
      • Freebase module
      • Google Books module
      • Google Images module
      • Pixabay module
      • Qwant Images module
      • Related Keywords module
      • RSS Fetcher module
      • Twitter module
      • Youtube module
    • Feed modules
      • General information
      • Field mapping
      • Mass import
      • Price comparison based on feeds
      • Troubleshooting
    • Module cloning
    • Deprecated modules
    • My network isn't listed
    • Affiliate Egg integration
    • Deeplink settings
  • Set Up Products
    • How to add products
    • Price comparison websites
    • Autoblogging
    • Fill tool
    • Products page
    • How to add badge icons
  • Frontend
    • How content is displayed
    • 🆕Gutenberg blocks
    • 👉Shortcode parameters
    • Product groups/variations
    • Product sorting
    • Featured images
    • Frontend Search
    • Translation
    • Greenshift templates
  • Updating products
    • Price update
    • Product list update
    • Why prices don't update
    • Out-of-stock products
    • Price history
    • Price alert
    • Price movers
  • 🪄AI
    • Activating AI features
    • AI content generation
    • Smart groups
    • OpenAI API
    • Claude API
    • OpenRouter API
    • Custom prompts
  • WooCommerce Integration
    • General information
    • Product synchronization
    • Attributes synchronization
    • WooCommerce and autoblogging
  • Integrations
    • Affiliate Egg Integration
    • Cashback Tracker Integration
    • External Importer integration
    • WooCommerce Integration
  • Custom Templates
    • Customizing templates with CSS
    • How to install a custom template
    • 🪄ChatGTP Template Creator
    • How to create a custom template
  • Customization
    • Localization
    • For developers
    • Useful code snippets
    • REST API
    • Compatibility with themes
  • FAQ
    • How to add price comparison blocks to WooCommerce
    • How to add custom logos for merchants
    • How to import from CSV data feeds
    • How to change the date format or the date is not being displayed
    • Is Content Egg GDPR Compliant?
    • How to add offer count as a custom field
    • How to add products programmatically
  • Troubleshooting
    • Small font size in product blocks
    • Nothing found while search
Powered by GitBook
On this page
  • Creating a Search Form
  • Customization
  1. Frontend

Frontend Search

PreviousFeatured imagesNextTranslation

Last updated 9 months ago

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.

Creating a Search Form

There are several ways to show the affiliate search form with Content Egg:

  1. 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.

  2. 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.

Search Settings

The next step is to set up the page for output results. To do this:

  1. Go to Content Egg – Settings – General.

  2. Add the output shortcode to the text area labeled Search page template.

I recommend using common shortcodes of Content Egg. For example:

[content-egg-block template=offers_list]

Customization

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:

<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...">
      <button type="submit">Search</button>
</form>

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:

add_filter('cegg_product_search_slug', 'example_callback');