Override Widgets (Call to Action) with Child Theme

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.

Hello there,

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:

  1. Open the parent theme’s functions.php file
  2. Comment out or just remove the following line
require get_template_directory() . "/widgets/fp-call-to-action.php";

Commented out

// require get_template_directory() . "/widgets/fp-call-to-action.php";
  1. Open functions.php file of your child theme, then add the following code
require get_stylesheet_directory() . "/widgets/fp-call-to-action.php";
  1. You’re done

Let me know how it goes.