Skip to content

Instantly share code, notes, and snippets.

@dcooney
Created December 5, 2015 01:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dcooney/01282eb182734b3601e9 to your computer and use it in GitHub Desktop.
Save dcooney/01282eb182734b3601e9 to your computer and use it in GitHub Desktop.
Comment - Full Example
<?php get_header(); ?>
<div id="loop-container" class="loop-container">
<?php
// The loop
if ( have_posts() ) :
while (have_posts() ) : the_post();
get_template_part( 'content' );
if(comments_open()) :
echo '<footer id="comments" class="comments">';
// comments_template(); // Removed in favor of Ajax Load More
$comment_count = get_comment_count($post->ID);
if ($comment_count['approved'] > 0) :
echo '<h3 class="comments-number">Comments ('. $comment_count["approved"] .')</h3>';
echo do_shortcode('[ajax_load_more comments="true" comments_post_id="'.get_the_ID().'" comments_per_page="4" comments_style="ol" comments_callback="ct_ignite_customize_comments" pause="true" button_label="Load Comments" button_loading_label="Loading Comments..."]');
endif;
comment_form(); // Standard WP Comment form
echo '</footer>';
endif;
endwhile;
endif;
?>
</div>
<?php get_footer(); ?>
@manplusplus
Copy link

hi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment