- This topic has 3 replies, 2 voices, and was last updated 11 years, 3 months ago by Sakin.
-
AuthorPosts
-
January 29, 2013 at 4:45 am #3425jencinasMember
Im trying to add a 3 column page, I was able to add sidebar2 to the widgets section. The problem is that when I add the second sidebar to the content-sidebar-right.php page I dont see the sidebar2 content on the page. here is the code
<?php
/**
* This is the template that displays page/post with right sidebar
*
* @package Catch Themes
* @subpackage Simple_Catch
* @since Simple Catch 1.3.2
*/
?>
<div id=”main” class=”layout-978″>
<div id=”content” class=”col4 no-margin-left”>
<?php while ( have_posts() ):the_post();
if( function_exists( ‘simplecatch_loop’) ) simplecatch_loop();
?>
<div class=”row-end”></div>
<?php comments_template(); ?>
<?php endwhile; ?>
</div><!– #content –>
<?php get_sidebar(); ?>
<?php get_sidebar2(); ?>
</div><!– #main –>
Thanks
January 29, 2013 at 11:54 am #3449SakinKeymaster@jencinas: You need to register the sidebar first and then only edit the code. But do this by building the child theme don’t edit the theme itself.
January 29, 2013 at 8:56 pm #3484jencinasMemberI created sidebar2.php based on sidebar.php. Also I created sidebar2 funcion on the function.php page.
<?php
/**
* The Sidebar containing the main widget area.
*
* @package Catch Themes
* @subpackage Simple_Catch
* @since Simple Catch 1.0
*/
global $post;
if( $post )
$layout = get_post_meta( $post->ID,’simplecatch-sidebarlayout’, true );
if( empty( $layout ) || ( !is_page() && !is_single() ) )
$layout=’default’;
global $simplecatch_options_settings;
$options = $simplecatch_options_settings;
$themeoption_layout = $options[‘sidebar_layout’];
if( $layout==’left-sidebar’ ||( $layout==’default’ && $themeoption_layout == ‘left-sidebar’) ) {
echo ‘<div id=”sidebar2″ class=”col4 no-margin-left”>’;
} else {
echo ‘<div id=”sidebar2″ class=”col4″>’;
}
if ( function_exists( ‘dynamic_sidebar’ ) ) {
//displays ‘sidebar’ for all pages
dynamic_sidebar( ‘sidebar2′ );
}
?>
</div><!– #sidebar –>
<?php
if(!( $layout==’left-sidebar’ ||( $layout==’default’ && $themeoption_layout == ‘left-sidebar’) ) ) {
echo ‘<div class=”row-end”></div>’;
}
/**
* Register sidebars and widget areas.
*/
function sidebar2() {
register_widget( ‘CustomTagWidget’ );
register_sidebar( array(
‘name’ => __( ‘sidebar2’, ‘simplecatch’ ),
‘id’ => ‘sidebar2’,
‘description’ => __( ‘sidebar2’, ‘simplecatch’ ),
‘before_widget’ => ‘<div class=”widget”>’,
‘after_widget’ => ‘</div>’,
‘before_title’ => ‘<h3>’,
‘after_title’ => ‘</h3><hr/>’
) );
}
add_action( ‘widgets_init’, ‘sidebar2’ );
I can see the sidebar2 widget on the widgets page on the admin site, but I cannot see the widget added to sidebar2 on the page.
January 30, 2013 at 12:25 pm #3500 -
AuthorPosts
- The topic ‘3 column page’ is closed to new replies.