For the complete documentation index, see llms.txt. This page is also available as Markdown.

Custom output templates

You can create your own templates for your storefronts. Don't edit the built-in templates — your changes would be lost when the plugin updates.

Custom templates are PHP files — creating one takes some basic PHP knowledge. The easiest start is to copy a default template and adjust it.

First, create the following directory:

wp-content/affegg-templates

To get started quickly, you can copy one of the default templates as a base.

Default templates are located in wp-content/plugins/affiliate-egg/templates.

Template files must be named with the prefix egg_.

Each template file must begin with a PHP comment that defines its name, for example:

/*
Name: Simple
*/

Using the built-in styles

Affiliate Egg's CSS isn't loaded just because your template renders — a template pulls in its own styles by calling one of these on the first line:

<?php $this->enqueueModernStyle(); ?>   // modern styling (affegg-modern.css)
<?php $this->enqueueStyle(); ?>         // legacy styling (Bootstrap 3 + products.css)

If you copy a default template as a base, that call is already there — so the built-in styling loads and you can just tweak the markup and CSS classes. Keep the line if you want to build on the default look and only customise the layout.

If you start from scratch and leave both calls out, no plugin CSS is loaded, and your template is styled entirely by your theme or your own CSS — handy when you want full control.

Last updated