WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Adding comments to pages (11 posts)

  1. web-betty
    Member
    Posted 5 years ago #

    I have another question regarding a template I'm using for this blog: 10 Things. How can I enable comments on pages, not just posts? I know each template is different, and my other blog (The Web-Betty blog) allows comments on pages (check out the "Ephemera" page).

    The template is called Bewildered 1.0 and came from here: 3columnwordpressthemes

    Any help or guidance is greatly appreciated.

    Thanks!

    Melissa

  2. web-betty
    Member
    Posted 5 years ago #

    New day, new forum viewers. :)

    I'm still looking for guidance on this issue. As you can see from my other posts, I try and do as much troubleshooting on my own as I can, but I am far from a WP expert and this has me stumped (I know nothing about PHP).

    Any help is greatly appreciated.

  3. Jeremy Clark
    Moderator
    Posted 5 years ago #

    You'll need to add this line where you want your comment form to show on you page.php file.

    <?php comments_template(); ?>

  4. Roy
    Member
    Posted 5 years ago #

    It's probably not that simple, but I guess you should just put this in your page.php:
    <?php comments_template(); ?>

    In my theme it's just above:
    <?php endwhile; else: ?>

    [edit] Jeremy was three seconds faster than myself.

  5. web-betty
    Member
    Posted 5 years ago #

    You guys are brilliant! I tried to copy some code that looked like it was what I needed and it obviously was not correct.

    This worked like a charm

    Thank you for the assistance!

  6. MoMowlam2
    Member
    Posted 5 years ago #

    Thanks from me too! I was pointed here by Drew Stauffer (theme: Elements of SEO), very helpful theme developer.

    It worked just fine for me too.

  7. jkendo
    Member
    Posted 5 years ago #

    Thanks Peeps! Worked for me too :-)

  8. thiseclecticlife
    Member
    Posted 5 years ago #

    Lifesavers, is what you are. This worked perfectly.

  9. prasadgupte
    Member
    Posted 5 years ago #

    How do I restrict this only for pages with the 'Allow Comments' option enabled?

  10. prasadgupte
    Member
    Posted 5 years ago #

    This didn't really work for Pixeled. So I figured this out after some playing around... Wrapped a COMMENT div around the PHP function call, also added CLEARED div because that's the way it renders on posts. Hope this helps

    <?php if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>
    <div class="topPost">  <h2 class="topTitle"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
      <div class="topContent"><?php the_content('(continue reading...)'); ?></div><strong>
    <div class="cleared"></div>
    <div id="comment"><div class="cleared"></div>
    <?php comments_template(); ?>
    </div></strong>
    </div> <!-- Closes topPost -->
    
    <?php endwhile; ?>
    
    <?php else : ?>
  11. kckal
    Member
    Posted 5 years ago #

    anyone know how to hide the add-comment link when a post or a page still shows it?
    i can disable the ability for someone to make a comment to a post or page while using /wp-admin but there is the problem still of a link still showing "add comment."

Topic Closed

This topic has been closed to new replies.

About this Topic