Skip to content
This repository has been archived by the owner on Sep 16, 2019. It is now read-only.

Comments template cleaned up and refactored #1296

Merged
merged 2 commits into from Oct 29, 2018

Conversation

derweili
Copy link
Collaborator

I cleaned the comments page (replaced the hardcoded comment form with comment_form()) template tag) to fix several problems with third party plugins #1291 and I added a comments pagination to support comments on multiple pages #1295

I also removed some unnecessary conditions like the check if the template is loaded on page() or single(). I compared the comments template to the official comments templte of the twentyseventeen theme. Since the official theme does not include any of this statements I decided to remove them.

@derweili
Copy link
Collaborator Author

PR also fixes #1289

comments.php Outdated
@@ -37,9 +36,11 @@
);

?>
<?php
the_comments_pagination();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer if we implemented Foundation pagination styles using custom SCSS classes here. Can this be done with that function? Or do we need to fix Foundationpress_Comments so it paginates?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right. I will update the pull request. I will replace the the_comments_pagination(); funktion with a Foundation specific one. Similar to the foundationpress_pagination() function.

comments.php Outdated
<?php do_action( 'comment_form', $post->ID ); ?>
</form>
<?php endif; // If registration required and not logged in. ?>
<?php comment_form(array(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please format like this:

    <?php
    comment_form(
        array(
            'class_submit' => 'button'
        )
    );
    ?>

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated the pull request

@@ -10,7 +10,6 @@
*/

if ( have_comments() ) :
if ( ( is_page() || is_single() ) && ( ! is_home() && ! is_front_page() ) ) :
?>
<section id="comments">
<?php
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add an <hr> here? I think it makes the the comments section easier to decipher from the post content with one.

EDIT: So it's clear, I'm talking right before the <section> element.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a good idea but also we still could add a line with CSS and border, which will avoid adding hr element...

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are already using an <hr> element between the comments and the leave a reply form.

Questions for everybody:

  1. Do we want a line in both places or just one of the places? (between post and comments, and between comments and comment reply form)
  2. Should we make this line with CSS or with <hr>?

Copy link
Contributor

@JPOak JPOak Aug 7, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would either remove the <hr> in both places or just add the <hr> element. I lean towards being less opinionated when it comes to design.

Copy link
Collaborator Author

@derweili derweili Sep 4, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the <hr> from the pull request

Copy link
Collaborator

@colin-marshall colin-marshall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few changes and some feedback/discussion is needed before merge.

@colin-marshall
Copy link
Collaborator

@derweili any feedback on the proposed changes?

@derweili
Copy link
Collaborator Author

derweili commented Sep 4, 2018

@colin-marshall I updated the pull requests with all required changes

  • removed the unnecessary <hr> tag
  • replaced the the_comments_pagination() with a foundation specific one
  • formatted the comments_form() function correctly

@olefredrik
Copy link
Owner

@derweili @colin-marshall Could you review and agree on the requested changes so that we can move forward and merge this pull request? Thanks!

@derweili
Copy link
Collaborator Author

@derweili @colin-marshall Could you review and agree on the requested changes so that we can move forward and merge this pull request? Thanks!

I implemented all change requests. Are there any further changes needed?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants