WordPress.org

Support

Support » How-To and Troubleshooting » It’s hard to modify widgets look

It’s hard to modify widgets look

  • Right now I’m coding and designing my own WordPress theme, but I can’t figure out how to edit the widgets to look right. When no widgets are on, my default sidebar looks like this:

    <div id="widget">
    					<h3>Title</h3>
    					<ul>
    						<li>Link 1</li>
    						<li>Link 2</li>
    					</ul>
    				</div>

    …I know when widgets are on, WordPress will declear the different styles, attributes, classes – whatever.. so I was thinking if anyone could help me get my widgets to look like my default sidebar widget?

    Here’s a screenshot of how it looks in action (default sidebar).

    Colorize_1244115955487.png

    Edit: The latst posts are all just dummies… Here’s how my CSS looks:

    #widget {
    -moz-border-radius-bottomleft:3px;
    -moz-border-radius-bottomright:3px;
    -moz-border-radius-topleft:3px;
    -moz-border-radius-topright:3px;
    background:#FFFFFF none repeat scroll 0 0;
    border:1px dashed #BBBBBB;
    margin:0 0 32px;
    overflow:hidden;
    padding:15px 15px 0;
    }
    #widget ul li {
    border-bottom:1px dashed #BBBBBB;
    padding:4px 0 7px;
    }
    #widget ul .children li {
    border:medium none;
    padding:0 0 0 8px;
    }
    #widget ul {
    list-style-image:none;
    list-style-position:outside;
    list-style-type:none;
    margin:0 0 25px;
    }

    Need more code? Please tell. 🙂

Viewing 1 replies (of 1 total)
  • Do you have this, or something similar in your functions.php file?

    if ( function_exists('register_sidebar') )
      register_sidebars(1,array(
          'before_widget' => '<div class="widget">',
          'after_widget' => '</div><!--/widget-->',
          'before_title' => '<h2 class="hl">',
          'after_title' => '</h2>',
          ));

    … and something like this “wrapping” the widget area:

    <?php if (function_exists('dynamic_sidebar') && dynamic_sidebar(1) ) : else : ?>
    ...
    <?php endif; ?>

    Also consider, CSS should be “.” for class as widgets are multiple occurences on the same page versus “#” for IDs, or single occurences.

Viewing 1 replies (of 1 total)
  • The topic ‘It’s hard to modify widgets look’ is closed to new replies.
Skip to toolbar