WordPress.org

Ready to get started?Download WordPress

Forums

How to add own peramters to your css sidebar? (9 posts)

  1. PureRushh
    Member
    Posted 2 years ago #

    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!

  2. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

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

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

  3. PureRushh
    Member
    Posted 2 years ago #

    Hi,

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

  4. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

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

  5. PureRushh
    Member
    Posted 2 years ago #

    But how can I close the "after-title" ?

  6. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    But how can I close the "after-title" ?

    please post your 'register_sidebar()' code;

  7. PureRushh
    Member
    Posted 2 years ago #

    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>
  8. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    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>'
    	));
  9. PureRushh
    Member
    Posted 2 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Topic