Hi there, As the title says... I have a theme which has two sidebars. Which is the default template. I need a page template with just one sidebar. This will give me more space for content. The site on which the theme is used is www.applykar.com Code (markup): I had done this previously but don't exactly remember how Any help would be appreciated
Do you want the whole site to be just one sidebar, or just a single page? If you want the whole site to be 1 side bar you can open up the "sidebar.php" and delete the following code (the right sidebar). After that you will need to edit the css for <div class="sidebar left-sidebar"> and set it to the new sidebar width. P.S. I would back everything up first. <div class="span-4 last"> <div class="sidebar right-sidebar"> <?php if(get_theme_option('rssbox') == 'true') { ?> <div class="socialboxes"> <a href="<?php bloginfo('rss2_url'); ?>"><img src="<?php bloginfo('template_url'); ?>/images/rss.png" alt="RSS Feed" title="RSS Feed" style="vertical-align:middle; margin-right: 5px;" /></a><a href="<?php bloginfo('rss2_url'); ?>"><?php echo get_theme_option('rssboxtext'); ?></a> </div> <?php } ?> <?php if(get_theme_option('twitter') != '') { ?> <div class="socialboxes"> <a href="<?php echo get_theme_option('twitter'); ?>"><img src="<?php bloginfo('template_url'); ?>/images/twitter.png" alt="<?php echo get_theme_option('twittertext'); ?>" title="<?php echo get_theme_option('twittertext'); ?>" style="vertical-align:middle; margin-right: 5px;" /></a><a href="<?php echo get_theme_option('twitter'); ?>"><?php echo get_theme_option('twittertext'); ?></a> </div> <?php } ?> <?php if(get_theme_option('ads_125') != '') { ?> <div class="sidebaradbox125"> <?php sidebar_ads_125(); ?> </div> <?php } ?> <ul> <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Sidebar 2') ) : ?> <li><h2>Archives</h2> <ul> <?php wp_get_archives('type=monthly'); ?> </ul> </li> <?php wp_list_bookmarks(); ?> <?php endif; ?> </ul> <?php if(get_theme_option('ad_sidebar2_bottom') != '') { ?> <div class="sidebaradbox"> <?php echo get_theme_option('ad_sidebar2_bottom'); ?> </div> <?php } ?> </div> </div> PHP:
Thanks BFiggy for the reply... I just want to delete the sidebar on few pages... hence I need a new page template... so that i can select while posting / add a page..
Ahh I see. In that case, you can create a second sidebar (name it something like "sidebar2.php") and add this at the very top of the PHP file <?php /* Template Name: Second Sidebar */ ?> PHP: Then when you create a new page select "Second Sidebar" on the right side where it says "Page Attributes" > "Template"
The problem with your theme is that both sidebars are in the one file, sidebar.php, so just creating a new page template isn't going to work. What I'd personally do is split the two sidebars into two separate files, then in your existing templates add an extra sidebar call so they're both in there and everything is back to normal. THEN you can create a new page template that only includes one of them. Info on creating page templates is here, and some info on calling sidebars over here.
Thanks kiramanic for your reply... this is what exactly I was looking for... I will try to make the template now!!
I have managed to delete the sidebar... But I don't understand how to delete the vertical line... please see here