• I am designing a site using Twenty Ten as a parent theme. I am trying to make the widgets in the sidebar look like this: Example.

    Each widget should have a custom header image, which should then seamlessly connect with a border around the widget content. I think I have kind of achieved this is by defining a class (‘widget-content’) around the widget content in functions.php, and then styling the class in style.css. The code (when changed) looks like this (see final line):

    // Area 1, located at the top of the sidebar.
    	register_sidebar( array(
    		'name' => __( 'Primary Widget Area', 'twentyten' ),
    		'id' => 'primary-widget-area',
    		'description' => __( 'The primary widget area', 'twentyten' ),
    		'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
    		'after_widget' => '</li>',
    		'before_title' => '<h3 class="widget-title">',
    		'after_title' => '</h3><h3 class="widget-content">',
    	) );

    I would then add each custom header image as a background in each widget title. So I have a few questions:

    1) Is this the best way to achieve this?
    2) If so, what is the code I should add to functions.php? After messing around for a bit I got lucky by adding <h3 class=”widget-content”> but (i) is h3 the correct tag? (ii) and would I (and where would I) need to close the tag?
    3) And finally, how can I change the functions.php using my child theme rather than editing the functions.php in the parent theme?

    Been stuck fiddling around with this for a while now, so really grateful for any guidance.

  • The topic ‘Changing the appearance of widgets in Twenty Ten’ is closed to new replies.