WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Double comment form... (7 posts)

  1. mountain991
    Member
    Posted 1 year ago #

    Hi,

    On this page, http://umotivateu.com/intro/ I have a double comment form. I'm using the twentytwelve theme. Any advice for eliminating the redundant form?

    Thanks,

    mountain

  2. alchymyth
    Forum Moderator
    Posted 1 year ago #

    have you edited content-page.php or comments.php in any way?

    the comment form is done by a plugin - which one, and have you chaecked any settings?

  3. mountain991
    Member
    Posted 1 year ago #

    Hi,
    I added this: <?php comments_template('', true); ?> to the page.php document because without it comments don't seem to work at all. In Settings -> Discussions the box is checked allowing folks to make comments on new pages. For old pages I have enabled comments on a page by page basis. I can get more specific about settings if you need me to.

    Thanks for responding.

    All the best,

    mountain

  4. alchymyth
    Forum Moderator
    Posted 1 year ago #

    double check page.php, as the unedited page.php of Twenty twelve already contains the line <?php comments_template( '', true ); ?>

    section of original page.php:

    <?php while ( have_posts() ) : the_post(); ?>
    				<?php get_template_part( 'content', 'page' ); ?>
    				<?php comments_template( '', true ); ?>
    			<?php endwhile; // end of the loop. ?>
  5. mountain991
    Member
    Posted 1 year ago #

    This is my page.php

    <?php
    /**
    * The 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_Twelve
    * @since Twenty Twelve 1.0
    */

    get_header(); ?>

    <div id="primary" class="site-content">
    <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_sidebar(); ?>
    <?php get_footer(); ?>

    I added the <?php comments_template('', true); ?> myself after reading about it in a forum post. It did strike me as strange that I would have had to modify this file just to get comments to work but without that line the comment section doesn't appear at all in the page.

    Is there another .php document I should check. I should also mention that I have JetPack comments enabled but that just seems to add additional options to the comments configuration.

    Thanks for your help.
    Mountain

  6. mountain991
    Member
    Posted 1 year ago #

    Also I found the line of code: <?php comments_template('', true); ?> in this file: page-template/full-width.php. We are using this full width no sidebar option in the template options. However, removing this line from the full-width.php document has no effect leaving two forms for comments on the pages, removing the line of code from the page.php document leaves no forms for comments at all.

    Also, this is having no effect on the comments function in the actual blog posts. Here you get a link that says leave a reply.

    Thanks

    mountain

  7. mountain991
    Member
    Posted 1 year ago #

    Solved!!!!

    I had the following in my comments.php file

    <?php comments_template( '', true ); ?>
    <?php comment_form( array( 'title_reply' => 'Comment' ) ); ?>

    By removing the first reference I got rid of the redundancy of forms.

    All the best,

    mountain

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.