Widget modifications in a child theme

Can I modify widgets in a child theme? When I change the footer, I don’t need extra steps — it just works. What about widgets?

Example:
A widget of a theme I am using makes use of google maps. I’d like to add some options to google maps options array.

Read More

My idea is to just copy the widget to the appropriate directory in the child theme and add those lines. Will that work as expected?

Related posts

Leave a Reply

2 comments

  1. Widget are not part of hierarchical parent/child theme relation, so you would need to follow more generic development process:

    1. Optionally disable widget registration in parent theme (if possible to do cleanly – with hooks or otherwise).
    2. Extend (as in widget’s PHP class) or fork (copy and modify the code) widget in child theme.
    3. Register your version in child theme.
  2. Most of advanced parent themes provide actions and filters too hook into functionality, if this theme doesn’t provide filter for google maps widget’s options array, then your solution is good way to go.