Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #3425
    jencinas
    Member

    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

    #3449
    Sakin
    Keymaster

    @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.

    #3484
    jencinas
    Member

    I 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.

    #3500
    Sakin
    Keymaster

    @jencinas: Send me your child theme zip file and then I will look at it.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘3 column page’ is closed to new replies.