Adding a column without changing template (5 posts)

  1. flick_is
    Posted 2 years ago #

    Hiya there,

    I'd really like to add another column to the right hand site of my website, http://www.getyourrockout.com

    without changing the template over, so I can display widgets in it as I do in the sidebar on the left of the page.

    I've absolutely no idea how to do this!

    Is there anybody who could help at all?

    Thanks so much,


  2. Michael
    Part-Time Forum Moderator
    Posted 2 years ago #

    without changing template

    won't work - you will need to change the theme (at least some of the templates) to achieve that.

  3. flick_is
    Posted 2 years ago #

    Ahh, I thought that would be the answer - sad!

    Thanks so much,


  4. Michael
    Part-Time Forum Moderator
    Posted 2 years ago #

    while keeping the same theme, you would need to:

    - edit header.php (or any other suitable template(s)) to add a call for the right sidebar; something like <?php get_sidebar('right'); ?>;

    - edit functions.php to add the register_sidebar() code for the new widget areas;

    - add a new sidebar-right.php with the correxponding code;

    - edit style.css to add styles to format the new sidebar (this is imho the most challenging part of the customisation).

    general: http://codex.wordpress.org/Widgetizing_Themes

  5. Michael
    Part-Time Forum Moderator
    Posted 2 years ago #


    the header.php edit could be:

    <?php get_sidebar('second'); ?>
    				<div id="main">

    the functions.php added code could be:

    register_sidebar( array(
    	'name'          => 'Second Sidebar',
    	'id'            => 'second',
    	'description'   => '')

    the sidebar-second.php code could be:

    <div id="sidebar" class="second">
    			<?php 	/* Widgetized sidebar, if you have the plugin installed. */
    					if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('second') ) : ?>
    			<?php /* If this is the frontpage */ if ( is_home() || is_page() ) { ?>
    					<?php wp_register(); ?>
    					<li><?php wp_loginout(); ?></li>
    			<?php } ?>
    			<?php endif; ?>

    for the formatting, you will need to create space for the new sidebar, this involves several of the div where the width is close to 900px;
    you will need to add at least:

    /* Sidebar second */
    #sidebar.second {
    	float: left;
    	width: 190px;
    	margin-left: 15px;
    	margin-right: 0;

    (possibly much more if you need the sidebars to be of different widths)

    and you will need to adjust a whole lot of background images.

    (this has not taken into account whatever changes you already made to the styles, as your sidebar is on the left and a different width as compared to the original theme)

Topic Closed

This topic has been closed to new replies.

About this Topic