Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working with custom comments loop #38

Open
elliottmangham opened this issue Feb 21, 2022 · 0 comments
Open

Not working with custom comments loop #38

elliottmangham opened this issue Feb 21, 2022 · 0 comments

Comments

@elliottmangham
Copy link

Hey there,

We have comments displaying within a simple custom theme, followed by the default comment_form() for creating comments.

When we install and enable Simple Comment Editing, nothing happens - which I assume is due to it being custom.

Please, can you advise how we can get the plugin to work within this pretty simple loop?

                    <?php if ( comments_open( $post_id ) || count( $comments ) > 0 ) :

                        echo '<div class="body_comments">';

                            foreach ( $comments as $comment) :

                                $date = date_create( $comment->comment_date );
                                $date_formatted = date_format( $date, 'd M Y' ) . ' at ' . date_format( $date, 'g:i a' );

                                ?>

                                <div class="comments_item">
                                    <div class="item_content item_col"><?php echo $comment->comment_content; ?></div>
                                    <div class="item_meta item_col">
                                        <div class="meta_author"><?php echo $comment->comment_author; ?></div>
                                        <div class="meta_date"><?php echo $date_formatted ; ?></div>
                                    </div>
                                </div>

                            <?php endforeach;

                        echo '</div>';

                        echo '<div class="body_comment">';

                            comment_form( [], $post_id );

                        echo '</div>';

                    endif; ?>

Thank you and kindest regards.

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

No branches or pull requests

1 participant