WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Comments On Pages (15 posts)

  1. chanel
    Member
    Posted 5 years ago #

    I want comments on my pages and when I add the following code <?php comments_template(); ?> it makes my sidebar go UNDERNEATH my content. Here is how I coded it on page.php:

    <?php get_header(); ?>
    <div id="main">
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <div class="post">
    <div class="post-title"><img src="http://kisschanel.com/hearts.jpg" style="float:left" alt="" /> " style="text-decoration:none;" rel="bookmark" title="Permanent Link: <?php

    the_title(); ?>"><?php the_ttftitle(); ?>
    </div>

    <div class="entrytext">

    <div align="justify"><?php the_content('<p class="serif">Read the rest of this page »</p>'); ?></div>

    <?php link_pages('<p>Pages: ', '</p>', 'number'); ?>

    </div>
    </div>
    <?php comments_template(); ?>
    <?php endwhile; endif; ?>

    </div>
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    <img src="http://chanellie.com/footer.jpg" alt="" />
    </div>

    Any suggestions or reason why this is happening? I tried moving it to different places but it just makes it worse. My site is chanellie.com

  2. Dagon Design
    Member
    Posted 5 years ago #

    It is most likely a CSS formatting issue, but it is hard for me to tell without seeing the problem in action. If you would like to enable the comments on pages again just for a bit I can take a look.

  3. chanel
    Member
    Posted 5 years ago #

    Hi Dagon. Here's a link to a test page:

    http://chanellie.com/?page_id=131

  4. Dagon Design
    Member
    Posted 5 years ago #

    The sidebar code needs to be after this:

    </div>
    
    <!-- End #content -->

    Right now, it is directly above it.

    It is trickier for me to see exactly how the template files are structured of course - all I can see is the html output, but that may do the trick. Let me know.

  5. chanel
    Member
    Posted 5 years ago #

    Okay. I did that but now there's the word "No" right next to my navigation. So that solved the sidebar problem. But why is it saying "No"? LOL.

  6. chanel
    Member
    Posted 5 years ago #

    <?php get_header(); ?>
    <div id="main">
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <div class="post">
    <div class="post-title"><img src="http://kisschanel.com/hearts.jpg" style="float:left" alt="" /> " style="text-decoration:none;" rel="bookmark" title="Permanent Link: <?php the_title(); ?>"><?php the_ttftitle(); ?>
    </div>

    <div class="entrytext">

    <div align="justify"><?php the_content('<p class="serif">Read the rest of this page »</p>'); ?></div>

    <?php link_pages('<p>Pages: ', '</p>', 'number'); ?>

    </div>
    </div>

    <?php endwhile; endif; ?>

    </div>
    <?php get_sidebar(); ?>

    <?php comments_template(); ?>
    <?php get_footer(); ?>

    <img src="http://chanellie.com/footer.jpg" alt="" />
    </div>

  7. Dagon Design
    Member
    Posted 5 years ago #

    That is quite odd :) The 'No' is coming from the first part of 'No comments so far'.

    I would think that you would also need the comments_template to be called above the end of the main div.. traditionally something like this is used:

    container
    --main
    ----post stuff
    ----comment stuff
    --sidebar

    But it depends on how your theme is laid out.

  8. chanel
    Member
    Posted 5 years ago #

    oh wow @ the "No" coming from that statement, lol.

    As for the rest, I don't quite understand what you mean. You didn't see anything odd with the source code I provided above?

  9. Dagon Design
    Member
    Posted 5 years ago #

    I would try changing it to the code below, but if the floats were done in a particular way, it might not help. Worth a shot though.

    If not, if you wanted to send me your theme files I could test it out on my server and get it working.

    <?php get_header(); ?>
    <div id="main">
    
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    
    <div class="post">
    <div class="post-title"><img src="http://kisschanel.com/hearts.jpg" style="float:left" alt="" /> " style="text-decoration:none;" rel="bookmark" title="Permanent Link: <?php the_title(); ?>"><?php the_ttftitle(); ?>
    </div>
    
    <div class="entrytext">
    
    <div align="justify"><?php the_content('<p class="serif">Read the rest of this page ยป</p>'); ?></div>
    
    <?php link_pages('<p>Pages: ', '</p>', 'number'); ?>
    
    </div>
    </div>
    
    <?php comments_template(); ?>
    
    <?php endwhile; endif; ?>
    
    </div>
    
    <?php get_sidebar(); ?>
    
    <?php get_footer(); ?>
    
    <img src="http://chanellie.com/footer.jpg" alt="" />
    </div>
  10. chanel
    Member
    Posted 5 years ago #

    yeahhhh, I just tried that code and it still didn't work.

    What's your email address so I can email you the zip file of the theme?

  11. Dagon Design
    Member
    Posted 5 years ago #

    matt at
    dagondesign dot com

  12. chanel
    Member
    Posted 5 years ago #

    ok. my email is chanellies
    at gmail dot com.

    I just sent it.

  13. Dagon Design
    Member
    Posted 5 years ago #

    It looks like not only did it have to be placed in the proper area, but it also needed an extra closing div after it, due to the code in the comments file.

    That should work :) It works for me at least.

  14. chanel
    Member
    Posted 5 years ago #

    Dagon, you're my hero. It worked. I can't believe you got it in 5 minutes versus my 5 HOURS of trying to figure it out.

    Sadness everywhere.

    But thank you so much!

  15. Dagon Design
    Member
    Posted 5 years ago #

    No problem :)

Topic Closed

This topic has been closed to new replies.

About this Topic