• Hi.

    Is it possible for me to have diffrent sidebars for my pages on my webside?
    How do I do it?

    Thanks for helping!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Add below code in your theme function file(wp-content/themes/your_theme_name/functions.php).

    if ( function_exists(‘register_sidebar’) )
    {
    register_sidebar(array(
    ‘name’ => ‘Left Side’,
    ‘before_widget’ => ‘<div id=”%1$s” class=”widget”>’,
    ‘after_widget’ => ‘</div>’,
    ‘before_title’ => ‘<h4>‘,
    ‘after_title’ => ‘
    </h4>’,
    ));

    ……………..
    ………………
    }

    You can call your side bar in your page like this(By name).
    <?php if ( !function_exists(‘dynamic_sidebar’) || !dynamic_sidebar(‘Left Side’) ) : ?><?php endif; ?>

    Thread Starter sunsi55

    (@sunsi55)

    Hi.
    And thanks for helping!

    I don`t quiite get it tho..
    This is how my function.php now looks like:

    <?php
    /**
     * Functions - Framework gatekeeper
     *
     * This file defines a few constants variables, loads up the core framework file,
     * and finally initialises the main WP Framework Class.
     *
     * @package WPFramework
     * @subpackage Functions
     */
    
    define( 'WP_FRAMEWORK', '0.2.4' ); // Defines current version for WP Framework
    
    	/* Blast you red baron! Initialise WP Framework */
    	require_once( TEMPLATEPATH . '/library/framework.php' );
    	WPFramework::init();
    ?>

    Where should I post the code you gave me? Should I just replace the old one?
    After that problem is solved:
    How do I then make new sidebars that I can call to the diffrent pages?

    Once again.Thanks!

    Hi You can replace this code in your function file.

    <?php
    /**
     * Functions - Framework gatekeeper
     *
     * This file defines a few constants variables, loads up the core framework file,
     * and finally initialises the main WP Framework Class.
     *
     * @package WPFramework
     * @subpackage Functions
     */
    
    define( 'WP_FRAMEWORK', '0.2.4' ); // Defines current version for WP Framework
    
    	/* Blast you red baron! Initialise WP Framework */
    	require_once( TEMPLATEPATH . '/library/framework.php' );
    	WPFramework::init();
    
    // Register sidebars
    if ( function_exists('register_sidebar') )
            {
            register_sidebar(array(
            'name' => 'Left Side',
            'before_widget' => '<div id="%1$s" class="widget">',
            'after_widget' => '</div>',
            'before_title' => '<h4>',
            'after_title' => '</h4>',
            ));
    
            register_sidebar(array(
            'name' => 'Right Side',
            'before_widget' => '<div id="%1$s" class="widget">',
            'after_widget' => '</div>',
            'before_title' => '<h4>',
            'after_title' => '</h4>',
            ));
    
    }
    ?>
    
    Thread Starter sunsi55

    (@sunsi55)

    I am not sure how I create new sidebars and add them to my spesific pages?

    I have some stuff to do now, but ill try to get it to work within tomorrow.
    And I will give you an update in this post on how I am doing within tomorrow night:)

    Thanks alot for helping! I am very thankful! Great help! ??

    Thread Starter sunsi55

    (@sunsi55)

    Hi again.
    When I fill in the Code you gave me. I get a error msg. Your attempt to edit functions.php have failed.
    Why?

    I Have one Origanal Sidebar where I now have Pic A and Pic B.
    For some other pages on my website i want to have Pic C and Pic D. So i guess I have to code that some place?

    <a href="https://x.com/home"><img class="alignnone size-full wp-image-16" title="Pictitle" src="https://x.com/x/wp-content/uploads/2010/09/PicA.jpg" alt="" width="180" height="150" " Heihei" /></a>
    <a href="https://x.com/Home"><img class="alignnone size-full wp-image-16" title="Pictitle"src="https://x.com/x/x/uploads/2010/09/PicB.jpg" alt="" width="780" height="80" " Heihei" /></a>

    This is my sidebar code at the moment.

    So what I am asking, where do I write the code to my other sidebars, and how do I get them to appear on a spesific page?

    Thanks for helping me! ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to get diffrent sidebars for pages’ is closed to new replies.