WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Can't seem to enable "add comment" on pages (8 posts)

  1. Prodromoi
    Member
    Posted 4 years ago #

    Hi.

    I though this might be a theme-related problem but now I'm not sure...

    On the 'fixed' pages of my blog (the ones that I believe use the page.php template) I am unable to add a box for people to comment below the page content.

    1. I encountered this using my theme of Preference, Galactica - but I changed the theme via the dashboard back to the default WordPress 1.6 one and I experienced the same problem - no "add comment" box.

    2. On the Settings/Discussion page "Allow people to post comments on new articles" is enabled.

    3. On 'Edit Page' for each of the fixed pages that I'm having this problem with "Allow Comments" is checked. (Ultimately I will uncheck some, but I need to fix this first!)

    4. I have tried unchecking/updating/reloading/checking again/updating/reloading the checkbox in point 3 above, in case it needed a nudge.

    5. The "add comments" box is appearing exactly as it should for 'normal' blog entries - just not the 'fixed pages'.

    A couple of examples of the pages that I'm having this problem with:
    http://www.outsider.org.uk/blog/?page_id=2
    http://www.outsider.org.uk/blog/?page_id=351

    So... how can I enable the facility to add comments to these pages? All help greatly appreciated!

    Thanks in advance.
    A

  2. BPartch
    Member
    Posted 4 years ago #

    Is this in the page.php file?

    <?php comments_template(); ?>

  3. Prodromoi
    Member
    Posted 4 years ago #

    No, it isn't... I begin to see the problem!

    This is the page as it stands:

    <?php get_header(); ?>
    
    <?php get_sidebar(); ?>
    
    <div class="text">
    
    		<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    
    			<div class="post">
    				<h1 class="title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
    				Posted by <?php the_author(); ?> on
    				<?php the_time('F j, Y'); ?>
    				<?php the_content('Read the rest of this entry &raquo;'); ?>
    				<div class="postinfo">
    					<div class="alignright"><a href="<?php the_permalink(); ?>#comments">Comments (<?php comments_number('0','1','%'); ?>)</a></div>
    				</div>
    			</div>
    			<div class="postline"></div>
    
    		<?php endwhile; endif; ?>
    
    </div>
    
    <?php get_footer(); ?>

    Whereabouts would you suggest adding that piece of code? Presumably after the "comments_number" line somewhere, but where?

    Looking hopeful...!

  4. BPartch
    Member
    Posted 4 years ago #

    Try this :)

    <div class="postline"></div>
    
    <?php comments_template(); ?>
    
    <?php endwhile; endif; ?>
  5. Prodromoi
    Member
    Posted 4 years ago #

    'Tis solved...

    I added it directly following the
    <div class="postline"></div>
    entry and it seems to be just fine, including switching off comments on the pages for which the facility is not needed/required.

    Many thanks for the help!
    A

  6. Prodromoi
    Member
    Posted 4 years ago #

    Ah, we crossed in our posts. Fortunately, that was where I thought it belonged!

    Much obliged!

  7. BPartch
    Member
    Posted 4 years ago #

    Glad you got it sorted. Happy Blogging!!! :)

  8. chrisin2
    Member
    Posted 4 years ago #

    In my page.php...where do I add the <?php comments_template(); ?>

    --------------------------------------------------------
    <?php get_header(); ?>

    <div id="casing">
    <div id="content">

    <?php if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>

    <div class="post" id="post-<?php the_ID(); ?>">
    <div class="title">
    <h2>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></h2>
    </div>

    <div class="cover">
    <div class="entry">
    <?php the_content('Read the rest of this entry »'); ?>
    <div class="clear"></div>
    <?php wp_link_pages(array('before' => '<p>Pages: ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
    </div>

    </div>

    </div>

    <?php endwhile; endif; ?>
    </div>

    <?php get_sidebar(); ?>

    <?php get_footer(); ?>

Topic Closed

This topic has been closed to new replies.

About this Topic