Add plus 2 footer widget

Hi!

I want to add more 2 footer area widget into the Sydney Child Theme’s functions.php file.

Is there any solution for this problem?

Thank you very much!

Hello there,

Firstly replicate footer.php file from main theme to your child theme’s folder. Find these code block

    <?php if ( is_active_sidebar( 'footer-1' ) ) : ?>
    	<?php get_sidebar('footer'); ?>
    <?php endif; ?>

And add the below code after it.

    <div id="extra-sidebar-footer" class="extra-footer-widgets widget-area" role="complementary">

      <div class="container">
      
        <?php if ( is_active_sidebar( 'extra-footer-1' ) ) : ?>
          <div class="sidebar-column col-md-6">
            <?php dynamic_sidebar( 'extra-footer-1'); ?>
          </div>
        <?php endif; ?>	

        <?php if ( is_active_sidebar( 'extra-footer-2' ) ) : ?>
          <div class="sidebar-column col-md-6">
            <?php dynamic_sidebar( 'extra-footer-2'); ?>
          </div>
        <?php endif; ?>	
        
      </div>  

    </div><!-- /#extra-sidebar-footer -->

Then add this snippet to your child theme’s functions.

    add_action( 'widgets_init', 'sydney_child_add_extra_footer_widgets_init' );
    function sydney_child_add_extra_footer_widgets_init() {

    	register_sidebar( array(
    		'name'          => __( 'Extra Footer 1', 'sydney' ),
    		'id'            => 'extra-footer-1',
    		'description'   => '',
    		'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    		'after_widget'  => '</aside>',
    		'before_title'  => '<h3 class="widget-title">',
    		'after_title'   => '</h3>',
    	) );

      register_sidebar( array(
    		'name'          => __( 'Extra Footer 2', 'sydney' ),
    		'id'            => 'extra-footer-2',
    		'description'   => '',
    		'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    		'after_widget'  => '</aside>',
    		'before_title'  => '<h3 class="widget-title">',
    		'after_title'   => '</h3>',
    	) );
      
    }  

You’ll have two sidebar areas under Appearance > Widgets. Extra Footer 1 and Extra Footer 2.

Regards,
Kharis