How can I override file featured-image-first.php of Avada theme

The question:

I use the Avada theme, and I have created a child theme (Customweb) for it.

I tried to override the file:

wp-content/themes/Avada/includes/lib/inc/templates/featured-image-first.php

And I try create that file in at:

wp-content/themes/Customweb/includes/lib/inc/templates/featured-image-first.php

But it doesn’t work.

Thank you for your help.

The Solutions:

Below are the methods you can try. The first solution is probably the best. Try others if the first one doesn’t work. Senior developers aren’t just copying/pasting – they read the methods carefully & apply them wisely to each case.

Method 1

Child themes let you override templates loaded via WordPress’ template loading mechanism, e.g. get_template_part or the main theme templates such as index.php and single.php.

But they can’t be used to replace arbitrary PHP files or assets.

If a theme loads a template file using require or include, WordPress cannot intercept this and replace it with a child theme version.

If this is the case, then you will need to find an alternative method to achieve your goal. Check with the themes documentation, the author may have provided a method to do this, such as an option or filter, or you may need to fork the theme.


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Comment