• Resolved aprilia

    (@aprilia)


    Is this possible? I would like to have a ‘standard’ sidebar on the home page and a separate one with a google ad-block on the ‘single’ page that is the entire article. I have copied and modified that sidebar.php file and saved it as sidebar_single.php. I changed the “get_sidebar” callout to “get_sidebar_single” and got an “undefined function” error.

    Where (ugh – and how) do I define the function?

    I am a php newb. I have a php manual that I am reading at the moment, but would like to know if this is reasonably simple or not. I am using the cleanbreeze theme.

    https://motorcyclebloggers.com

    Thanks.

Viewing 5 replies - 1 through 5 (of 5 total)
  • “get_sidebar” is refering to the php function that calls the file “sidebar.php”
    What you need to change is the function or make a new one that calls your new file as a sidebar…
    I haven’t actually checked this out but from my current knowledge you would have to find out which wordpress file the function “get_sidebar” is in then either copy that and make a new function to call or to rename it to call your other sidebar.

    Hope this helps..

    Chadwick is close, but you don’t need to modify any core files. You just need to follow the instructions in the Codex for Include Tags, specifically for “Including Any Template” on that page.

    https://codex.www.ads-software.com/Include_Tags

    If “sidebar_single.php” is in your theme directory, you should be able to use

    <?php include (TEMPLATEPATH . '/sidebar_single.php'); ?>

    Thread Starter aprilia

    (@aprilia)

    I will try that tonight.

    Thanks a bunch to the both of you!

    Thread Starter aprilia

    (@aprilia)

    Worked like a charm. Thanks!

    can someone please tell me what i am doing wrong? i’ve followed every instruction about multiple sidebars in the support forum and codex lessons and it STILL does not work for me. clearly i have no idea what i am doing.

    i’ve inserted the
    <?php include (TEMPLATEPATH . ‘/sidebar_about.php’); ?> onto my about.php file and it doesn’t do anything no matter where it is placed.

    <?php
    /*
    Template Name: About
    */
    ?>

    <?php get_header(); ?>

    <div id="content" class="widecolumn">

    </div>
    <?php include (TEMPLATEPATH . '/sidebar_about.php'); ?>
    <?php get_footer(); ?>

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Multiple Sidebars’ is closed to new replies.