custom page with custom side bar
-
Hi all
One of those annoying newbies here…
I have made two custom pages
page_my_homepage.php
page_testimonial.phpand I have registred two new sidebar names in functions.php
/* two new sidebars */ register_sidebar( array( 'name' => __( 'my homepage Sidebar', 'twentytwelve' ), 'id' => 'my homepage sidebar', 'description' => __( 'Appears on posts and pages except the my Front Page template, has its own widgets', 'child of twentytwelve' ), 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 'after_widget' => '</aside>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>', ) ); register_sidebar( array( 'name' => __( 'testimonial page Sidebar', 'twentytwelve' ), 'id' => 'testimonial page sidebar', 'description' => __( 'Appears on testimonial page only template, has its own widgets', 'child of twentytwelve' ), 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 'after_widget' => '</aside>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>', ) ); /* end two new sidebars */
I cannot workout how to call the sidebars into the pages as there is no reference to sidebars in the page files all they contain is this (copied from page.php
get_header(); ?> <div id="primary"> <div id="content" role="main"> <?php while ( have_posts() ) : the_post(); ?> <?php get_template_part( 'content', 'page' ); ?> <?php comments_template( '', true ); ?> <?php endwhile; // end of the loop. ?> </div><!-- #content --> </div><!-- #primary --> <?php get_footer(); ?>
Could someone point me at what I am missing please. I am not keen to use widgets or plugins as I would prefer to learn what is happening “under the bonnet”
Mark
[Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]
Viewing 15 replies - 1 through 15 (of 15 total)
Viewing 15 replies - 1 through 15 (of 15 total)
- The topic ‘custom page with custom side bar’ is closed to new replies.