WordPress.org

Support

Support » How-To and Troubleshooting » Sidebar at the bottom of single posts when not logged in

Sidebar at the bottom of single posts when not logged in

Viewing 10 replies - 1 through 10 (of 10 total)
  • corewpress
    Member

    @corewpress

    Hi Mike,
    For some reason you have your sidebar code inside the “comments” div block. You should check your single.php code to understand what’s going on.

    You can paste it here if you like us to take a look.

    Best
    Diego

    <?php
    /**
    * Single pages for posts
    *
    * @package WordPress
    * @subpackage Chronicle
    */
    ?><?php get_header(); ?>

    <?php
    global $wp_query;
    $urlTemp = get_bloginfo( ‘template_url’ );
    ?>

    <div id = “content”>
    <div id = “maincontent”>
    <div class = “posts”>

    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    <div class = “post postpage” id = “post-<?php the_ID(); ?>” >

    <?php if ( has_post_thumbnail() ) : ?>
    <div class = “post_left”>
    <?php the_post_thumbnail(); ?>
    </div><!–end “post_left”–>
    <?php endif; ?>

    <div class = “<?php if ( has_post_thumbnail() ) { echo ‘post_right’; } else { echo ‘post_long’; } ?>”>
    <h2>” rel=”bookmark” title=”<?php the_title_attribute(); ?>”><?php the_title(); ?></h2>
    <div class = “post_meta”>
    <span class = “first”><?php the_time( ‘F jS, Y’ ) ?></span>
    <span> <?php the_category( ‘, ‘ ) ?></span>
    <span class = “last”>
    </div>
    </div><!–end “post_right”–>

    <div class = “fullcontent”>
    <?php the_content( ” ); ?>
    </div><!–end “fullcontent”–>
    </div><!–end “post postpage”–>
    </div><!–end “posts”–>

    <?php comments_template(); ?>

    </div><!–end “maincontent”–>

    <?php endwhile; else : ?>

    <div class = “post”>
    <p>No posts found. Search for something else.</p>
    </div><!–end “post”–>

    <?php endif; ?>

    <div id = “sidecontent”>
    <?php get_sidebar(); ?>
    </div>

    </div><!– end “content”–>
    <?php get_footer(); ?>

    corewpress
    Member

    @corewpress

    Hi Mike,

    You code looks fine. Are you using any Text widget with HTML in it ? Maybe you have a bad closing tag or something there.

    Double check that and let us know.

    no its all built in widgets

    corewpress
    Member

    @corewpress

    Yes, I know. But if you are using the Text/HTML widget, you may be adding a bad tag in there.

    corewpress
    Member

    @corewpress

    Hi!

    Try using the following code as your single.php file (backup the current file first).

    <?php
    /**
    * Single pages for posts
    *
    * @package WordPress
    * @subpackage Chronicle
    */
    ?><?php get_header(); ?>
    
    <?php
    global $wp_query;
    $urlTemp = get_bloginfo( 'template_url' );
    ?>
    
    <div id = "content">
    	<div id = "maincontent">
    		<div class = "posts">
    
    			<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    			<div class = "post postpage" id = "post-<?php the_ID(); ?>" >
    
    				<?php if ( has_post_thumbnail() ) : ?>
    				<div class = "post_left">
    					<?php the_post_thumbnail(); ?>
    				</div><!--end "post_left"-->
    				<?php endif; ?>
    
    				<div class = "<?php if ( has_post_thumbnail() ) { echo 'post_right'; } else { echo 'post_long'; } ?>">
    					<h2>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></h2>
    					<div class = "post_meta">
    						<span class = "first"><?php the_time( 'F jS, Y' ) ?></span>
    						<span> <?php the_category( ', ' ) ?></span>
    						<span class = "last">
    					</div>
    				</div><!--end "post_right"-->
    
    				<div class = "fullcontent">
    					<?php the_content( '' ); ?>
    				</div><!--end "fullcontent"-->
    
    			</div><!--end "post postpage"-->
    			<?php endwhile; else : ?>
    				<div class = "post">
    				<p>No posts found. Search for something else.</p>
    				</div><!--end "post"-->
    			<?php endif; ?>
    
    		</div><!--end "posts"-->
    
    		<div><?php comments_template(); ?></div>
    
    	</div><!--end "maincontent"-->
    
    	<div id = "sidecontent">
    	<?php get_sidebar(); ?>
    	</div>
    
    </div><!-- end "content"-->
    <?php get_footer(); ?>

    didnt work

    Yo Mike –

    I think there’s a span that’s not getting closed:

    `<span class = “last”>

    either remove that (there’s nothing in there) or close it with a </span>

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Sidebar at the bottom of single posts when not logged in’ is closed to new replies.