Community @ The Turning Gate

Support community for TTG plugins and products.

NOTICE

The Turning Gate's Community has moved to a new home, at https://discourse.theturninggate.net.

This forum is now closed, and exists here as a read-only archive.

  • New user registrations are disabled.
  • Users cannot create new topics.
  • Users cannot reply to existing topics.

You are not logged in.

#1 2015-11-20 05:19:37

PhilippeH
Member
From: Paris, France
Registered: 2014-04-11
Posts: 167

comments.php

Good evening,

I wonder if it is normal that there is commente.php file twice this text:

<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through? If so, show navigation ?>
        <nav role="navigation" id="comment-nav-below" class="site-navigation comment-navigation">
            <h1 class="assistive-text"><?php _e( 'Comment navigation', 'loc' ); ?></h1>
            <div class="nav-previous"><?php previous_comments_link( __( '&larr; Older Comments', 'loc' ) ); ?></div>
            <div class="nav-next"><?php next_comments_link( __( 'Newer Comments &rarr;', 'loc' ) ); ?></div>
        </nav><!-- #comment-nav-below .site-navigation .comment-navigation -->
        <?php endif; // check for comment navigation ?>


Thank you for your response.

Regards,

Philippe

Offline

#2 2015-11-20 15:10:24

Matthew
Administrator
From: San Francisco, CA
Registered: 2012-09-24
Posts: 5,795
Website

Re: comments.php

Is that my code, or yours?

If my code, are you having a problem with it?

If yours, what are you trying to do?


Matt

The Turning Gate, http://theturninggate.net

Offline

#3 2015-11-20 17:26:09

PhilippeH
Member
From: Paris, France
Registered: 2014-04-11
Posts: 167

Re: comments.php

Hello, and thank you for your answer!

When I import the Wordpress theme with Lightroom, that is the comments.php file that is exported:

<?php

/*
* If the current post is protected by a password and
* the visitor has not yet entered the password we will
* return early without loading the comments.
*/
if (post_password_required())
    return;
?>

<div id="comments" class="clearfix">

    <?php if (have_comments()): ?>
        <h3 class="comments-title">
        <?php
        printf( _n( 'One response to &ldquo;%2$s&rdquo;', '%1$s responses to &ldquo;%2$s&rdquo;', get_comments_number(), 'loc' ),
            number_format_i18n( get_comments_number() ), '<span>' . get_the_title() . '</span>' );
        ?>
        </h3>

        <?php if (get_comment_pages_count() > 1 && get_option('page_comments')): // are there comments to navigate through? If so, show navigation ?>
        <nav role="navigation" id="comment-nav-above" class="site-navigation comment-navigation">
            <h1 class="assistive-text"><?php _e( 'Comment navigation', 'loc' ); ?></h1>
            <div class="nav-previous"><?php previous_comments_link( __( '&larr; Older Comments', 'loc' ) ); ?></div>
            <div class="nav-next"><?php next_comments_link( __( 'Newer Comments &rarr;', 'loc' ) ); ?></div>
        </nav><!-- #comment-nav-before .site-navigation .comment-navigation -->
        <?php endif; // check for comment navigation ?>

        <ol class="commentlist">
        <?php wp_list_comments(array('callback' => 'shape_comment')); ?>
        </ol><!-- .commentlist -->

        <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through? If so, show navigation ?>
        <nav role="navigation" id="comment-nav-below" class="site-navigation comment-navigation">
            <h1 class="assistive-text"><?php _e( 'Comment navigation', 'loc' ); ?></h1>
            <div class="nav-previous"><?php previous_comments_link( __( '&larr; Older Comments', 'loc' ) ); ?></div>
            <div class="nav-next"><?php next_comments_link( __( 'Newer Comments &rarr;', 'loc' ) ); ?></div>
        </nav><!-- #comment-nav-below .site-navigation .comment-navigation -->
        <?php endif; // check for comment navigation ?>

    <?php endif; // have_comments() ?>

    <?php // If comments are closed and there are comments, let's leave a little note, shall we?
        if (!comments_open() && '0' != get_comments_number() && post_type_supports(get_post_type(), 'comments')):
        echo '<p class="nocomments">' . __( 'Comments are closed.', 'loc' ) . '</p>';
        endif;
    ?>

    <?php
        $comments_args = array(
            'comment_notes_before' => __('<p class="comment-notes">Your email address will not be published. Required fields are marked *</p>', 'loc'),
            'title_reply' => __('<i class="fa fa-fw fa-comments-o"></i> Leave a Comment', 'loc'),
            'title_reply_to' => __('<i class="fa fa-fw fa-comments-o"></i> Leave a Reply to %s', 'loc'),
            'cancel_reply_link' => __('<i class="fa fa-fw fa-times"></i> Cancel Reply', 'loc'),
        );
   
        comment_form($comments_args);
    ?>

</div><!-- #comments -->


There are also duplicate files in footer.php or woocommerce.php

What I wanted to know was if this was normal?

Regards,

Philippe

Offline

#4 2015-11-20 18:33:53

Matthew
Administrator
From: San Francisco, CA
Registered: 2012-09-24
Posts: 5,795
Website

Re: comments.php

Should be fine as coded. Are you observing some problem?


Matt

The Turning Gate, http://theturninggate.net

Offline

#5 2015-11-20 19:46:35

PhilippeH
Member
From: Paris, France
Registered: 2014-04-11
Posts: 167

Re: comments.php

No, I have no problem.
I just asked myself the question.
Thanks again.
Best regards.
Philippe

Offline

Board footer

Powered by FluxBB