Viewing 4 replies - 1 through 4 (of 4 total)
  • You’ll have to create a separate page template for each custom sidebar you want running.

    Once you’ve done that, you need to create your custom sidebar templates. Name them something that allows you to remember what they contain.

    For example, let’s create three different sidebars in addition to the default sidebar.php:

    contact-sidebar.php
    about-sidebar.php
    custom-sidebar.php

    In order to pull those in on the page we want them, we’ll need to create three different pages. They don’t have to be different other than the call to the specific sidebar, but they can if you need them to.

    Don’t forget to put the custom page code at the top of each, like this:

    <?php
    /*
    Template Name: Custom Page Name
    */
    ?>

    Then for each custom page template, find this code:
    <?php get_sidebar(); ?>

    And substitute this instead, using the name of the desired sidebar template you just created:

    <?php include (TEMPLATEPATH . '/custom-sidebar.php'); ?>

    That way, each custom page has its own custom sidebar. There may be an easier way to do this, but that’s how I’ve done it on my site as well, with a custom sidebar for my contact info on my Contact Us page. ??

    HTH.

    The easiest way of having different sidebars for each page is using the Custom Sidebars plugin:

    https://www.ads-software.com/extend/plugins/custom-sidebars/

    Don’t have to know anything about coding for using it and it have a lot of options for personalize your site completely.

    @ Marquex
    Thanks. I have the plug-in installed, but can you guide me here, that how i am gonna connect a specific custom bar to specific page.

    You have a couple howtos at the bottom of the page

    https://marquex.posterous.com/pages/custom-sidebars

    Basically you have to tell the plugin what are the sidebars of your theme you want to change for some pages and then in the page-edition, in the admin area you will see a new box to define what sidebar the page will have.

    There is also a mini how to about creating and widgetizing new sidebars.

    Not difficult, if you have problems just tell me.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to use different-different custom sidebars on few pages and default for rest’ is closed to new replies.