The MU forums have moved to WordPress.org

create new sidebar (7 posts)

  1. umair
    Member
    Posted 16 years ago #

    i wanna add a new sidebar to my site.

    i came to know that some modifications need to be done in functions.php. But, could not find any link. Can anyone please guide me ?

  2. demonicume
    Member
    Posted 16 years ago #

    well, first we gotta know what changes you want made. are These things that can be handled with widgets or Modules? i cant imagine what one might put in a side bar that would require changes to functions.php. what type of changes do ou want.... think there's also a sidebar editor which might do whatver it is you want.

  3. umair
    Member
    Posted 16 years ago #

    No no no no. its not like that i wanna make some modifications in an existing sidebar. there are two sidebars in the theme already. i wanna add a new one, and want to be able to widgetize that using the admin panel of wordpress.

    How is that ???

  4. dsader
    Member
    Posted 16 years ago #

    From http://automattic.com/code/widgets/themes/

    Functions.php needs to register the total number of sidebars:

    If one sidebar:

    if ( function_exists('register_sidebar') )
        register_sidebar();

    If 3:

    if ( function_exists('register_sidebars') )
        register_sidebars(3);

    I use Firefox and it's EditCSS add on to tinker with the css in themes.

  5. umair
    Member
    Posted 16 years ago #

    ohhh OKKKKK !
    Thanks a lot !

  6. oscarferreira
    Member
    Posted 15 years ago #

    I have this:
    <?php
    if ( function_exists('register_sidebar') )
    register_sidebar (array(
    'before_widget' => '<li id="%1$s" class="widget %2$s">',
    'after_widget' => '',
    'before_title' => '<h2 class="widgettitle">',
    'after_title' => '</h2>',
    ));

    function kubrick_head() {

    whre y put de 2 sidebar?

  7. dsader
    Member
    Posted 15 years ago #

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

    http://automattic.com/code/widgets/api/

About this Topic