
3 column twenty eleven http://zeaks.org
By:
Zeaks on Aug 16th, 2011 | syntax:
PHP | size: 1.45 KB | hits: 878 | expires: Never
*/ ADD TO FUNCTIONS.PHP */
// Register out extra sidebar for the three column layouts
register_sidebar( array(
'name' => __( 'Extra Sidebar', 'twentyeleven' ),
'id' => 'extra-sidebar',
'description' => __( 'The sidebar for three column layouts', 'twentyeleven' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => "</aside>",
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
/* ADD TO SIDEBAR.PHP AFTER #SECONDARY DIV */
<!-- Add our .extra-sidebar are for three column layouts -->
<div id="extra-sidebar" class="widget-area" role="complementary">
<?php if ( ! dynamic_sidebar( 'extra-sidebar' ) ) : ?>
<?php endif; // end extra sidebar widget area ?>
</div><!-- .extra-sidebar .widget-area -->
/* CSS for 3 column Layout
------------------------------------------------ */
#page { max-width: 989px;}
#primary {
float: left;
margin: 0 -26.4% 0 0;
width: 100%;
}
#content {
margin: 0 34% 0 26.4%;
width: 46.4%;
}
#secondary {
float: right;
margin-right: 2.6%;
width: 19.8%;
}
#extra-sidebar{
position:relative;
float: left;
width: 19.8%;
margin-left: -70%;
}
/* Adjust the comments */
.commentlist, #respond {
margin-right: -2%;
}
/* Extra sidebar fix for narrow browsers/media devices */
@media (max-width: 800px) {
#main #extra-sidebar{
float: none;
margin: 0 7.6%;
width: auto;
}
}