comments_template example

// Parent post navigation.         the_post_navigation(
            array(
                /* translators: %s: Parent post link. */
                'prev_text' => sprintf( __( '<span class="meta-nav">Published in</span><span class="post-title">%s</span>', 'twentytwentyone' ), '%title' ),
            )
        );
    }

    // If comments are open or there is at least one comment, load up the comment template.     if ( comments_open() || get_comments_number() ) {
        comments_template();
    }

    // Previous/next post navigation.     $twentytwentyone_next = is_rtl() ? twenty_twenty_one_get_icon_svg( 'ui', 'arrow_left' ) : twenty_twenty_one_get_icon_svg( 'ui', 'arrow_right' );
    $twentytwentyone_prev = is_rtl() ? twenty_twenty_one_get_icon_svg( 'ui', 'arrow_right' ) : twenty_twenty_one_get_icon_svg( 'ui', 'arrow_left' );

    $twentytwentyone_next_label     = esc_html__( 'Next post', 'twentytwentyone' );
    $twentytwentyone_previous_label = esc_html__( 'Previous post', 'twentytwentyone' );

    the_post_navigation(
        array(
            


get_header();

/* Start the Loop */
while ( have_posts() ) :
    the_post();
    get_template_part( 'template-parts/content/content-page' );

    // If comments are open or there is at least one comment, load up the comment template.     if ( comments_open() || get_comments_number() ) {
        comments_template();
    }
endwhile; // End of the loop.
get_footer();
$post        = get_post( $post_id );
    setup_postdata( $post );

    ob_start();

    /* * There's a deprecation warning generated by WP Core. * Ideally this deprecation is removed from Core. * In the meantime, this removes it from the output. */
    add_filter( 'deprecated_file_trigger_error', '__return_false' );
    comments_template();
    remove_filter( 'deprecated_file_trigger_error', '__return_false' );

    $output = ob_get_clean();
    $post   = $post_before;

    $classnames = array();
    // Adds the old class name for styles' backwards compatibility.     if ( isset( $attributes['legacy'] ) ) {
        $classnames[] = 'wp-block-post-comments';
    }
    if ( isset( $attributes['textAlign'] ) ) {
        

                    '<span class="edit-link">',
                    '</span><br>'
                );
            }
            ?> </footer><!-- .entry-footer --> </article><!-- #post-<?php the_ID(); ?> --> <?php     // If comments are open or there is at least one comment, load up the comment template.     if ( comments_open() || get_comments_number() ) {
        comments_template();
    }
} // End the loop.
get_footer();
Home | Imprint | This part of the site doesn't use cookies.