Putting Widgets Side by Side

This topic contains 3 replies, has 3 voices, and was last updated by  Paolo 9 years, 3 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #27012

    Dave C
    Expired Member
    Post count: 5

    I’ve created 3 custom widget areas and I was looking to put all 3 widgets side by side on a horizontal row.

    The Grid settings squish the 1 record that I am displaying per widget, and the List view seems to be just too wide, and also clears the Div making the next widget appear on the next line.

    Is there a way that I can make this happen some other way?

    It would look as so:

    Popular Widget (1) | Popular Widget (1) | Popular Widget (1)

    Thanks!

    #27085

    Guust
    Moderator
    Post count: 29970

    Just choose the 2 grid, and set the Listing width to 100.
    http://docs.wpgeodirectory.com/widgets/#popular-post

    Let us know how you went.

    #27177

    Dave C
    Expired Member
    Post count: 5

    OK! Classic case of RTFM on my end – after a bit of fiddling with CSS I have it.

    For anyone else looking to do so:

    functions.php

    
    
        register_sidebar( array(
        'name' => 'bottom-1',
        'id' => 'bottom-01',
        'before_widget' => '<div id="bottom-01">',
        'after_widget' => '</div>',
        'before_title' => '',
        'after_title' => ''
            ) );
            
    
        register_sidebar( array(
        'name' => 'bottom-2',
        'id' => 'bottom-02',
        'before_widget' => '<div id="bottom-02">',
        'after_widget' => '</div>',
        'before_title' => '',
        'after_title' => ''
            ) );
            
            
        register_sidebar( array(
        'name' => 'bottom-3',
        'id' => 'bottom-03',
        'before_widget' => '<div id="bottom-03">',
        'after_widget' => '</div>',
        'before_title' => '',
        'after_title' => ''
            ) );
    

    In your theme template (I am using geo-home.php)

    
    
    <div class="section group">
    	<div class="col span_1_of_3">
    	<?php dynamic_sidebar( 'bottom-01' ); ?>
    	</div>
    	<div class="col span_1_of_3">
    	<?php dynamic_sidebar( 'bottom-02' ); ?>
    	</div>
    	<div class="col span_1_of_3">
    	<?php dynamic_sidebar( 'bottom-03' ); ?>
    	</div>
    </div>
    

    In your style.css

    
    
    /*  SECTIONS  */
    .section {
    	clear: both;
    	padding: 0px;
    	margin: 0px;
    }
    
    /*  COLUMN SETUP  */
    .col {
    	display: block;
    	float:left;
    	margin: 1% 0 1% 1.6%;
    }
    .col:first-child { margin-left: 0; }
    
    /*  GROUPING  */
    .group:before,
    .group:after { content:""; display:table; }
    .group:after { clear:both;}
    .group { zoom:1; /* For IE 6/7 */ }
    
    /*  GRID OF THREE  */
    .span_3_of_3 { width: 100%; }
    .span_2_of_3 { width: 66.13%; }
    .span_1_of_3 { width: 32.26%; }
    
    /*  GO FULL WIDTH BELOW 480 PIXELS */
    @media only screen and (max-width: 480px) {
    	.col {  margin: 1% 0 1% 0%; }
    	.span_3_of_3, .span_2_of_3, .span_1_of_3 { width: 100%; }
    }
    

    And as mentioned bu Guust, Set the Widget areas to 2 grid and ‘100’ not 100% and you are golden!

    #27179

    Paolo
    Site Admin
    Post count: 31206

    Thanks for this Dave!

Viewing 4 posts - 1 through 4 (of 4 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket