Need a Tutorial how to design WP sidebar

Discussion in 'HTML & Website Design' started by LWS, Apr 19, 2010.

  1. #1
    Hello,

    I am building a WP theme and I need a tutorial how to totaly customize a sidebar :)

    all ul li things explained because I am prety much confused on how to use background images on this one...

    it seams that the sidebar design is somewhat predefined somewhere... like list style...

    what I need is to make a sidebar to look like this, you will get the idea where I want the tittle and where i want listed links :)
    i need this sidebar
    http://trazim-te.com/wp/wp-content/themes/1000goals/images/sidebar.jpg

    on this template
    http://trazim-te.com/wp/?p=3

    thank you in advance ;)
     
    Last edited: Apr 19, 2010
    LWS, Apr 19, 2010 IP
  2. javier.garcia.esteban

    javier.garcia.esteban Well-Known Member

    Messages:
    66
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    118
    #2
    Well, that isn't related to WordPress or sidebars at all (when I read the post title I thought you were talking about sidebar widgets), it's just a HTML/CSS issue. You basically want the same layout as the post, but with a different width. Check the HTML/CSS/images used for the post layout and then try to replicate that on the sidebar.
     
    javier.garcia.esteban, Apr 20, 2010 IP
  3. LWS

    LWS Well-Known Member

    Messages:
    584
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    120
    #3
    Last edited: Apr 20, 2010
    LWS, Apr 20, 2010 IP
  4. javier.garcia.esteban

    javier.garcia.esteban Well-Known Member

    Messages:
    66
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    118
    #4
    You can control the code returned by the widgets in a theme: codex. wordpress. org/Widgets_API

    In the register_sidebar function, the before_widget, after_widget... arguments. So you add your needed HTML to those arguments (<div> and stuff) and then style that HTML properly via CSS to look like the post on the left.
     
    javier.garcia.esteban, Apr 20, 2010 IP
  5. LWS

    LWS Well-Known Member

    Messages:
    584
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    120
    #5
    thank you :)

    I saw that and I suspected that this is where I need to do something :)

    ok, I'll play with this now :p
     
    LWS, Apr 20, 2010 IP
  6. aap

    aap Well-Known Member

    Messages:
    1,802
    Likes Received:
    39
    Best Answers:
    2
    Trophy Points:
    120
    #6
    can be easily done by dividing the image in three parts. Then define 3 separate class in style.css for each image

    use top image for title, middle (with repeat-y) for body and end with bottom image.
     
    aap, Apr 20, 2010 IP
  7. LWS

    LWS Well-Known Member

    Messages:
    584
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    120
    #7
    yes, I already have the image splited into 3 parts...

    it is only a problem to put them into the widget itself lol
     
    LWS, Apr 20, 2010 IP
  8. LWS

    LWS Well-Known Member

    Messages:
    584
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    120
    #8

    do I need to edit these:

    $defaults = array(
    'name' => sprintf(__('Sidebar %d'), $i ),
    'id' => "sidebar-$i",
    'description' => '',
    'before_widget' => '<li id="%1$s" class="widget %2$s">',
    'after_widget' => "</li>\n",
    'before_title' => '<h2 class="widgettitle">',
    'after_title' => "</h2>\n",
     
    LWS, Apr 20, 2010 IP
  9. javier.garcia.esteban

    javier.garcia.esteban Well-Known Member

    Messages:
    66
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    118
    #9
    If that's the code your theme is using, yes.
     
    javier.garcia.esteban, Apr 20, 2010 IP