• Resolved jrcollins

    (@jrcollins)


    I want to create a new sidebar widget area in the header of my child theme. What would be the best way to do this?

    Here is the code for one of the sidebars in the parent theme:

    <?php
    add_action( 'widgets_init', 'ci_widgets_init' );
    if( !function_exists('ci_widgets_init') ):
    function ci_widgets_init() {
    
    	register_sidebar(array(
    		'name' => __( 'Blog Sidebar', 'ci_theme'),
    		'id' => 'blog-sidebar',
    		'description' => __( 'The list of widgets assigned here will appear in your blog posts.', 'ci_theme'),
    		'before_widget' => '<aside id="%1$s" class="widget %2$s group">',
    		'after_widget' => '</aside>',
    		'before_title' => '<h3 class="widget-title"><span>',
    		'after_title' => '</span></h3>',
    ));
    }

    Can I just change the name, id and description and put it in my child theme’s functions file?

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘add new sidebar in child theme’ is closed to new replies.