• I’ve got a weird problem that I can’t seem to figure out.

    When I have comments turned on, the widgets appear on the right of the main text, just as they are supposed to do.

    However, if I turn off comemnts on a post, the widget moves below the maintext.

    This will show you what I mean:

    On
    http://moonworks.co/uncategorized/comments-turned-on

    Off
    http://moonworks.co/uncategorized/comments-turned-off

    I’ve found that if I add an extra </div> to the single.php page it will solve the problem when comments are turned off, but it totally messes up the page when they are turned on. I add the div here (the final div is extra):

    <?php comments_template(); ?>
    <div style="clear: both;"></div>
    </div></div>

    This is the code I have in the single.php file:

    <?php get_header(); ?>
    	<div id="wrapper">
    		<div id="column-setup">
    			<div class="postsmain">
    			<h1><?php the_title(); ?></h1><p>
    			<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    				<div class="content-styles"><?php the_content(__('Keep Reading'));?></div>
    			<?php endwhile; else: ?>
    			<?php endif; ?>
    			<?php comments_template(); ?>
    			<div style="clear: both;"></div>
    			</div>
    
    			<div class="postswidget">
    <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Pages') ) : ?>
    <?php endif; ?>
    			</div>
    		</div>
    	</div>
    <?php get_footer(); ?>

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator t-p

    (@t-p)

    Try:

    -deactivating ALL plugins. If the problem goes away, activate them individually to find the culprit?

    -if that does not resolve the issue, try switching to the default theme (Twenty Ten) by renaming your current theme’s folder in wp-content/themes to rule out any theme-specific issue?

    Thread Starter HorrorUK

    (@horroruk)

    Thanks,

    it isn’t a plugin causing the problem.

    I’m sure it is a theme problem, I’m trying to write my own.

    check comments.php for the missing div – it might be in conditional statements – i.e. only missing if the comments are turmned off.

    if you like, you can paste the code of comments.php of your theme into a http://wordpress.pastebin.com/ and post the link to it here.

    Thread Starter HorrorUK

    (@horroruk)

    Thanks.

    I’ve had a go at tryign to figure iut where it could be, but no luck :o(

    Here is my link on pastebin.com
    http://wordpress.pastebin.com/dSmY0CZ4

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘widgets move below main text when comments turned off’ is closed to new replies.