AffiliateWP provides flexibility by allowing you to modify its template files. By customizing templates through a child theme, you can tailor specific features while ensuring your changes remain intact during plugin updates.
Overview of Customizable Templates
AffiliateWP templates are categorized based on functionality. Below are the main templates available for customization:
Emails
body-default.php
: Email body.footer-default.php
: Email footer.header-default.php
: Email header.
Affiliate Dashboard Tabs
dashboard.php
: The main affiliate dashboard.dashboard-tab-urls.php
: The URLs tab.dashboard-tab-stats.php
: The Stats tab.dashboard-tab-graphs.php
: The Graphs tab.dashboard-tab-referrals.php
: The Referrals tab.dashboard-tab-payouts.php
: The Payouts tab.dashboard-tab-visits.php
: The Visits tab.dashboard-tab-creatives.php
: The Creatives tab.dashboard-tab-settings.php
: The Settings tab.
Forms and Restricted Access
login.php
: Affiliate login form.register.php
: Affiliate registration form.no-access.php
: Message displayed when a user lacks access.
Creatives
creative.php
: Template for the Creatives admin area.
Steps to Modify Templates
Using a Child Theme
Customizing templates via a child theme ensures your changes persist through AffiliateWP updates.
- Identify the template you want to modify from the plugin’s template folder.
- In your child theme directory, create a folder named
affiliatewp
. - Place the selected template file inside the
affiliatewp
folder. If you’re modifying email templates, create a subfolder namedemails
insideaffiliatewp
. - Open the copied template file in a code editor and make your modifications. Ensure you maintain proper PHP and HTML syntax.
- Once edited, upload the updated
affiliatewp
folder with its templates to your child theme directory.
When modifying email templates, ensure that the templates (body-default.php
, footer-default.php
, header-default.php
) are placed in the affiliatewp/emails
subfolder.
Using WPCode Plugin
If you prefer a simpler method to manage customizations, the WPCode plugin provides an efficient alternative.
- Download and activate the WPCode plugin.
- In your WordPress dashboard, go to WPCode » Snippets and click Add New Snippet.
- Select the option to add a PHP snippet.
- Paste your custom PHP code into the snippet editor.
- Toggle the snippet to active, save your changes, and verify the functionality.
For more guidance on WPCode, refer to the guide on adding code snippets in WordPress.
That’s it! Customizing AffiliateWP templates enables you to provide a tailored affiliate experience. Whether you opt for the child theme method or use the WPCode plugin, both approaches ensure your modifications are secure and persistent through updates. Always back up your site and thoroughly test changes for a seamless implementation.