• 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)
  • Moderator t-p

    (@t-p)

    Everything worked fine until the most recent parent theme update

    I recommend asking at https://www.ads-software.com/support/theme/oceanwp so the theme’s developers and support community can help you with this.

    • This reply was modified 7 years, 1 month ago by t-p.
    Moderator bcworkz

    (@bcworkz)

    If your parent theme changed registered sidebars, to get your widgets back you may just need to drag your widgets into the new sidebar on the widgets admin screen. If that doesn’t work, your best recourse is then as t-p suggests.

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.