WordPress.org

Ready to get started?Download WordPress

Forums

Unregistering Parent Theme Sidebar (2 posts)

  1. Andrew
    Member
    Posted 1 month ago #

    Hi Folks,
    I'm working with a handy responsive theme framework (Reverie) and I'm developing my own theme the right way using a Child theme. The Parent theme calls a sidebar called with an ID of 'Footer' and applies some basic styles to it. I want to adjust this in my child theme, so I was looking at perhaps filtering it but in the end I decided it'd probably be easiest to unregister the sidebar and re-register a new one with the proper classes in childtheme's functions.php.

    Yet, I'm not able to de-register the sidebar. I've attempted it, with the code below, but without any luck..

    // Unregisters Reverie footer sidebar
    function remove_footer(){
    	unregister_sidebar( 'Footer' );
    }
    add_action ('widgets_init, remove_footer', 11);
    
    // Registers new footer array with proper classes
    
    $sidebars = array('Childfeet');
    foreach ($sidebars as $sidebar) {
        register_sidebar(array('name'=> $sidebar,
        	'id' => 'Childfeet',
            'before_widget' => '<div class="small-12 medium-6 large-3 columns"><article id="%1$s" class="panel widget %2$s">',
            'after_widget' => '</article></div>',
            'before_title' => '<h4>',
            'after_title' => '</h4>'
        ));
    }

    My new sidebar with proper classes is of course created, but it seems like my remove_footer() does not do it's job. Any ideas?

    Thanks very much!

    Addition: Just so you can see the footer I'm trying to remove, here is it's declaration in the parent themes functions.php

    $sidebars = array('Footer');
    foreach ($sidebars as $sidebar) {
        register_sidebar(array('name'=> $sidebar,
        	'id' => 'Footer',
            'before_widget' => '<div class="large-3 columns"><article id="%1$s" class="panel widget %2$s">',
            'after_widget' => '</article></div>',
            'before_title' => '<h4>',
            'after_title' => '</h4>'
        ));
    }
  2. esmi
    Forum Moderator
    Posted 1 month ago #

    I'm sorry but as you appear to be using a non-WPORG parent theme, you need to seek support from the theme's developers - paid or otherwise. We only support themes downloaded from wordpress.org here.

Reply

You must log in to post.

About this Topic