12% off of LTD using this coupon: TWELVEPERCENTOFF. Promo ends on 2 Dec midnight UTC.
Published on Jan 6, 2021

How to override AffiliateWP templates using a custom functionality plugin

Sridhar Katakam

Looking to override AffiliateWP templates from a custom plugin instead of your child theme? This will be useful especially when using Oxygen since it disables the theme completely.

AffiliateWP provides a filter for that.

This members-only tutorial provides the steps on how to add a directory inside a custom functionality plugin to the list of paths that AffiliateWP checks for overriding its templates.

Note: It is better/easier and recommended to use actions and filter hooks where possible to customize plugins' output where possible. Template overriding should be the last resort.

Step 1

Install and activate My Custom Functionality plugin.

Connect to your hosting account using a FTP client and navigate to site's /wp-content/plugins/my-custom-functionality-master.

Create a directory named say, affiliatewp where you would like to copy the templates from the plugin to, for customizations.

Inside the plugin's plugin.php add:

This is a premium members-only content.

To view the rest of the content, please sign up for membership ($47/month or $599 one-time).

Already a member? Log in below or here.

tagschevron-leftchevron-rightchainangle-rightangle-upangle-downfolder-omagnifiercrossmenuchevron-downarrow-right