How do I stop WordPress parent theme from overriding child widget?
-
I’m using a child theme of the Ocean WP theme. I registered four widgets in the child theme’s functions.php file. Everything worked fine until the most recent parent theme update, which is replacing the second widget with “left sidebar.”
I found the offending section of the parent theme’s functions.php and commented out:
register_sidebar( array( 'name' => esc_html__( 'Left Sidebar', 'oceanwp' ), 'id' => 'sidebar-2', 'description' => esc_html__( 'Widgets in this area are used in the left sidebar region.', 'oceanwp' ), 'before_widget' => '<div class="sidebar-box %2$s clr">', 'after_widget' => '</div>', 'before_title' => '<h4 class="widget-title">', 'after_title' => '</h4>', ) );
Obviously, this doesn’t follow best practices. I assume I need to de-register the left sidebar in my child theme’s functions.php file but am not very familiar with php yet. What do I need to do to prevent the left sidebar from overriding my widget, in a way that conforms to best practices?
Thanks!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘How do I stop WordPress parent theme from overriding child widget?’ is closed to new replies.