WordPress.org

Support

Support » Themes and Templates » How to add own peramters to your css sidebar?

How to add own peramters to your css sidebar?

  • Hello!

    I am making my own wordpress them and hew met one problem with designing the sidebar. How could I add own css “Peramters” to the dynamic_sidebar(); ?

    Hope someone could answear me!

    Thank you!

    Have a nice weekend.
    PureRushh!

Viewing 8 replies - 1 through 8 (of 8 total)
  • Moderator Michael

    @alchymyth

    Forum Moderator

    have you worked through:
    http://codex.wordpress.org/Function_Reference/register_sidebar

    can you explain in more detail what you mean with ‘css parameter’?

    Hi,

    Yeah, like giving the sidebar titles a own css style and the content another style, do you understand what I mean?

    Moderator Michael

    @alchymyth

    Forum Moderator

    you can do this with the code for registering the sidebars – see link in my last reply.

    But how can I close the “after-title” ?

    Moderator Michael

    @alchymyth

    Forum Moderator

    But how can I close the “after-title” ?

    please post your ‘register_sidebar()’ code;

    if ( function_exists('register_sidebar') )
        register_sidebar();
    
    register_sidebar(array(
    	'name' => 'Sidebar',
    	'before_widget' => '<li id="%1$s" class="%2$s">',
    	'after_widget' => '</li>',
    	'before_title' => '<h2 class="sidebar">',
    	'after_widget' => '</h2>'
    	));

    This is how I want my sidebar to be http://cl.ly/3Z0r3q1J3D153E0R3D0Z/Skjermbilde%202012-01-29%20kl.%2000.19.09.png

    and this is how it is http://cl.ly/2S0h1m0S0W0p003H3Q2g/Skjermbilde%202012-01-29%20kl.%2000.20.17.png

    How the sidebar code should be:

    <div id="sidebar">
    	<h2 class="sidebar">Søk</h2>
        <div class="sidebar_item"><form action="http://test.sjohaugbygg.no/" method="get" class="search_field">
    <input type="text" class="search" value="Søk her..." name="s" />
    <input type="submit" value="Søk" name="search" class="search" />
    </form></div>
        <h2 class="sidebar">Siste innlegg</h2>
        <div class="sidebar_item"><div class="item_sidebar"></div></div>
        <h2 class="sidebar">Kommende kamper</h2>
        <div class="sidebar_item"><div class="item_sidebar"></div></div>
        <h2 class="sidebar">Siste resultater</h2>
        <div class="sidebar_item"><div class="item_sidebar"></div></div>
    </div>

    Moderator Michael

    @alchymyth

    Forum Moderator

    you possible have a typing mistake – should be:

    register_sidebar(array(
    	'name' => 'Sidebar',
    	'before_widget' => '<li id="%1$s" class="%2$s">',
    	'after_widget' => '</li>',
    	'before_title' => '<h2 class="sidebar">',
    	'after_title' => '</h2>'
    	));

    hi, but how can I style the content box after the widget title?

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘How to add own peramters to your css sidebar?’ is closed to new replies.