I’m looking to override a few of the widgets that come with the theme, mostly the Call to Action widget (fp-call-to-action.php). I’ve copied the file and the folder structure to my child theme, but I’m guessing I need to do something in functions.php to remove the original widget from Sydney and activate the widget in my child theme.
We can’t instantly overwrite that template file because it is actually a custom PHP file which isn’t part of native WordPress template hierarchy.
To make the
fp-call-to-action.php works in the child theme, please do the following:
- Open the parent theme’s functions.php file
- Comment out or just remove the following line
require get_template_directory() . "/widgets/fp-call-to-action.php";
// require get_template_directory() . "/widgets/fp-call-to-action.php";
- Open functions.php file of your child theme, then add the following code
require get_stylesheet_directory() . "/widgets/fp-call-to-action.php";
- You’re done
Let me know how it goes.