WordPress.org

Ready to get started?Download WordPress

Forums

It's hard to modify widgets look (2 posts)

  1. danishdove
    Member
    Posted 5 years ago #

    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. :)

  2. Edward Caissie
    Theme Review Admin
    Posted 5 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic