• Working site:
    https://www.fitzio.com/subsite/depaul

    I am trying to create a series of templates. Each displays a unique menu. I am not able to execute the first template successfully. It seems everthing is working except that the page using the template displays the default sidebar rather than the unique “about” nav.
    I followed this tutorial:
    https://codex.www.ads-software.com/Customizing_Your_Sidebar
    I am creating these templates in a child theme of twentyten, named dePaulSchool.

    I added the following code to my dePaulSchool/functions.php

    <?php if ( function_exists ('register_sidebar')) {
        register_sidebar ('about');
    } ?>

    I’m calling this first unique sidebar menu “about.”
    I made a copy of twentyten/sidebar.php and named it dePaulSchool/sidebar-about.php
    I added this code right after the tag for the search form:

    <!-- HERE IS THE UNIQUE MENU FOR THIS SIDEBAR ONLY -->
        <li id="about" class="widget-container">
    
        <?php if ( function_exists ( dynamic_sidebar(1) ) ) : ?>
    
        <?php dynamic_sidebar (1); ?>
        <?php endif; ?>
    
        <!-- END.. UNIQUE MENU FOR THIS SIDEBAR ONLY -->

    I created the template dePaulSchool/about-template.php
    I identified the template in the first comment successfully as it shows in the dashboard.

    I replaced the sidebar call with:

    <!-- This is my call for the unique sidebar -->
    <?php get_sidebar( 'about' ); ?>

    By testing arbitrary text to the sidebar-about.php file, it appears that sidebar-about.php is being ignored and the parent version (sidebar.php) is being displayed instead. Can you help me? I think I am really close here.

    [Please post code or markup snippets between backticks or use the code button.]

Viewing 3 replies - 1 through 3 (of 3 total)
  • [email protected]

    (@patparker100yahoocom)

    I have not been using the Twentyten theme much lately but looked at some of my code and found this call to my sidebar which worked:
    <?php include (‘wp-content/themes/twentyten-child/sidebarHome.php’); ?>

    Let me know if this helps,

    Pat

    [email protected]

    (@patparker100yahoocom)

    Ah, just looked at the link you sent and it appears that it should be a <?php include …?>
    not
    <?php get_sidebar() ?>

    Kurt

    (@highfxmedia)

    fitzio: I believe the #1 sidebar will be the default sidebar not your custom sidebar. Try using dynamic_sidebar(‘about’).

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘custom template with unique sidebar menu’ is closed to new replies.