Stripping Sidebar in Wordpress Theme

Discussion in 'PHP' started by duanehaas, Nov 30, 2009.

  1. #1
    I have a site that has a pretty long sidebar. When you click on the individual posts, it keeps the long sidebar and extends the page a little too much. How do I code out the parts that are no longer relevant when on the single page and keep the long sidebar on the main page?

    Here's all of the php code for my single page -

    <?php get_header(); ?>
    
    <div id="content">
    
    
    <div class="breadcrumb">
    
    <table style="text-align: left; width: 100%;" border="0" cellpadding="0" 
    
    cellspacing="0"><tr><td align="left" id="previous_post_container"><?php 
    
    previous_post('&laquo; %','','yes') ?></td><td></td><td align="right" 
    
    id="next_post_container"><?php next_post(' % &raquo;','','yes') ?
    
    ></td></tr></table>
    
    
    <?php if (have_posts()) : ?>
    
    <?php while (have_posts()) : the_post(); ?>
    <div class="single" id="post-<?php the_ID(); ?>">
    <div class="title">
    
    <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link 
    
    to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
    <div class="date"><span class="author">Posted by <?php the_author(); ?
    
    ></span> <span class="clock"> On <?php the_time('F - j - Y'); ?
    
    ></span></div>	
    </div>
    
    <div class="cover">
    <div class="entry">
    		
    					<?php the_content('Read the rest of 
    
    this entry &raquo;'); ?>
    			
    				 <div class="clear"></div>
    			
    </div>
    
    </div>
    
    <div class="singleinfo">
    					<div class="category"><?php 
    
    the_category(', '); ?> 
    
    </div>
    </div>
    </div>
    
    <div class="related">
    
    <?php if(function_exists('wp_related_posts')) { ?>
    <?php wp_related_posts(); ?>
    <?php } else { ?>
    <p> Activate the Wp-related-posts plugin to see the related post list! </p>
    <?php } ?> 
    
    </div>
    <div class="clear"> </div>
    <div class="allcomments"> 
    <?php comments_template(); ?>
    </div>
    	<?php endwhile; else: ?>
    
    		<h1 class="title">Not Found</h1>
    		<p>I'm Sorry,  you are looking for something that is not 
    
    here. Try a different search.</p>
    
    <?php endif; ?>
    
    </div>
    
    
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>
    PHP:
    I know it is the php get_sidebar() part of it so here is the sidebar portion of the php code

    <div id="rightcol">
    
    <?php include (TEMPLATEPATH . '/sponsors.php'); ?>
    
    <div id="sidebar">
    <?php include (TEMPLATEPATH . '/sidebar3.php'); ?>
    <?php include (TEMPLATEPATH . '/sidebar2.php'); ?>
    <?php include (TEMPLATEPATH . '/sidebar1.php'); ?>	
    	
    </div>
    </div>
    PHP:
    I do not need the /sponsors.php or the /sidebar3.php part of my sidebar.

    So pretty much I am needing to bypass getting the normal sidebar and get a basic stripped down sidebar with just /sidebar2.php and /sidebar1.php

    In my widgets screen, I can choose to place things in 3 different sections.

    Thanks for the help guys! If you need any more code, or links to things I can PM them to you.
     
    duanehaas, Nov 30, 2009 IP
  2. travelmoth

    travelmoth Active Member

    Messages:
    153
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #2
    travelmoth, Nov 30, 2009 IP
  3. duanehaas

    duanehaas Active Member

    Messages:
    153
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    73
    #3
    Thanks a lot travelmoth. I will try to get those implemented. I am pretty run and gun on php (i dont really know much about it but I screw with it enough to fake my way into solutions to my problems lol).

    Do you think I would place those in the individual areas (like /sponsors.php) or can i place it in the single.php?

    I really don't know where to start is what I am getting at.

    Thanks again
     
    duanehaas, Nov 30, 2009 IP