WordPress.org

Ready to get started?Download WordPress

Forums

Adding a column without changing template (5 posts)

  1. flick_is
    Member
    Posted 1 year 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,

    Felicity

  2. alchymyth
    The Sweeper & Moderator
    Posted 1 year 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
    Member
    Posted 1 year ago #

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

    Thanks so much,

    Felicity

  4. alchymyth
    The Sweeper & Moderator
    Posted 1 year 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'); ?>;
    http://codex.wordpress.org/Function_Reference/get_sidebar

    - edit functions.php to add the register_sidebar() code for the new widget areas;
    http://codex.wordpress.org/Function_Reference/register_sidebar

    - add a new sidebar-right.php with the correxponding code;
    http://codex.wordpress.org/Function_Reference/dynamic_sidebar

    - 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. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    general:

    the header.php edit could be:

    </ul>
    				</div>
    
    <?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">
    		<ul>
    			<?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() ) { ?>
    				<li><h2>Meta</h2>
    				<ul>
    					<?php wp_register(); ?>
    					<li><?php wp_loginout(); ?></li>
    				</ul>
    				</li>
    			<?php } ?>
    
    			<?php endif; ?>
    		</ul>
    	</div>

    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