WordPress.org

Ready to get started?Download WordPress

Forums

Twenty Twelve
How to add new classes to widgets in childtheme. (1 post)

  1. Jönson
    Member
    Posted 1 year ago #

    Hi, I've a childtheme and want to replace som settings in functions.php.
    If i create a new function.php in childteme, how to replace this:

    function twentytwelve_widgets_init() {
    	register_sidebar( array(
    		'name' => __( 'Main Sidebar', 'twentytwelve' ),
    		'id' => 'sidebar-1',
    		'description' => __( 'Appears on posts and pages except the optional Front Page template, which has its own widgets', 'twentytwelve' ),
    		'before_widget' => '<aside id="%1$s" class="widget %2$s drop-shadow lifted">',
    		'after_widget' => '</aside>',
    		'before_title' => '<h3 class="widget-title">',
    		'after_title' => '</h3>',
    	) );
    
    	register_sidebar( array(
    		'name' => __( 'First Front Page Widget Area', 'twentytwelve' ),
    		'id' => 'sidebar-2',
    		'description' => __( 'Appears when using the optional Front Page template with a page set as Static Front Page', 'twentytwelve' ),
    		'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' => __( 'Second Front Page Widget Area', 'twentytwelve' ),
    		'id' => 'sidebar-3',
    		'description' => __( 'Appears when using the optional Front Page template with a page set as Static Front Page', 'twentytwelve' ),
    		'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    		'after_widget' => '</aside>',
    		'before_title' => '<h3 class="widget-title">',
    		'after_title' => '</h3>',
    	) );
    }
    add_action( 'widgets_init', 'twentytwelve_widgets_init' );

    I dont know if it's needed, but I just want to add two more classes to before_widget' => '<aside id="%1$s" class="widget %2$s">

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic

Tags

No tags yet.