• I have moved my comments section out from the content section to just under it on optcenglish.com by moving <?php comments_template( ”, true ); ?> in-between get sidebar and get footer in page.php. but now it takes up the whole screen and covers the content.

    How can i have the huge grey area stay at the same height as the comment section title?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Greetings

    In theme TwentyEleven I believe there are some really good reason the comments template is within the div#content…

    What were you attempting to accomplish in the first place?

    <?php
    /**
     * Template for displaying all pages
     *
     * This is the template that displays all pages by default.
     * Please note that this is the WordPress construct of pages
     * and that other 'pages' on your WordPress site will use a
     * different template.
     *
     * @package WordPress
     * @subpackage Twenty_Eleven
     * @since Twenty Eleven 1.0
     */
    
    get_header(); ?>
    
    		<div id="primary">
    			<div id="content" role="main">
    
    				<?php while ( have_posts() ) : the_post(); ?>
    
    					<?php get_template_part( 'content', 'page' ); ?>
    
    					<?php comments_template( '', true ); ?>
    
    				<?php endwhile; // end of the loop. ?>
    
    			</div><!-- #content -->
    		</div><!-- #primary -->
    
    <?php get_footer(); ?>
    Thread Starter Roboc

    (@roboc)

    Im trying to have the comments div out of the content div. It would look a little better with the design i have in mind. The main problem is the huge gray area it creates when it’s taken out of the content div.

    It’s probably easier to leave the php templates alone (put them back how they were). And use CSS only to implement your design.

    The various comments elements would remain marked-up within the div#content. You can reposition them with CSS and you won’t have to deal with the large gray area at all.

    Thread Starter Roboc

    (@roboc)

    Thanks for the help Martin, but I don’t understand how i can re position the comments section out of the content div using just css

    Relative to it’s original position on the screen, To where would you want to move it?

    Thread Starter Roboc

    (@roboc)

    under the content box (so it isn’t inside the content box anymore)

    I don’t see any box around the content in my TwentyEleven example. And the comments templates is below a horizontal line, separated from the content. https://wpmulti.org/example-how-to-move-comments-on-page/

    I think you will need to revert whatever you did in order we can provide further assistance.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[theme: twenty eleven] moving comments section out of content section problem’ is closed to new replies.