custom template with unique sidebar menu
-
Working site:
https://www.fitzio.com/subsite/depaulI 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.]
- The topic ‘custom template with unique sidebar menu’ is closed to new replies.