WordPress.org

Forums

Sidebar at the bottom of single posts when not logged in (11 posts)

  1. Michael Burke
    Member
    Posted 1 year ago #

    Sidebar appears at the bottom of single posts in the comments area when not logged in

  2. Michael Burke
    Member
    Posted 1 year ago #

  3. corewpress
    Member
    Posted 1 year ago #

    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

  4. Michael Burke
    Member
    Posted 1 year ago #

    <?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(); ?>

  5. corewpress
    Member
    Posted 1 year ago #

    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.

  6. Michael Burke
    Member
    Posted 1 year ago #

    no its all built in widgets

  7. corewpress
    Member
    Posted 1 year ago #

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

  8. Michael Burke
    Member
    Posted 1 year ago #

  9. corewpress
    Member
    Posted 1 year ago #

    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(); ?>
  10. Michael Burke
    Member
    Posted 1 year ago #

    didnt work

  11. Bryan Purcell
    Member
    Posted 1 year ago #

    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>

Topic Closed

This topic has been closed to new replies.

About this Topic