Basic PHP help needed
-
Hi I have a question and I hope someone can help me.
I use the twenty seventeen theme and I want to edit the comments. I managed to achieve what I wanted however a small bit of the php does not feel right. I do not know php and even though it works fine now, I want to do it the proper way. This is the part I’m talking about:<?php endif; ?>I tried several ways but this is the only way I got it to function properly
Is there anyone that can tell me how to write this in a prober way?
This is the original code:endif; // Check for have_comments(). // If comments are closed and there are comments, let's leave a little note, shall we? if ( ! comments_open() && get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) : ?> <p class="no-comments"><?php _e( 'Comments are closed.', 'twentyseventeen' ); ?></p> <?php endif; comment_form(); ?> </div><!-- #comments -->And this is the the code how it’s now (after I edited).
endif; // Check for have_comments(). // If comments are closed and there are comments, let's leave a little note, shall we? if ( ! comments_open() && get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) : ?> <p class="no-comments"><?php _e( 'Comments are closed.', 'twentyseventeen' ); ?></p> <?php endif; ?> <div class="hidecform"> <input type="checkbox" id="toggle"> <label for="toggle" class="toggle" onclick=""></label> <?php comment_form(); ?></div> </div><!-- #comments -->Thanks for taking the time to read and I really appreciate your help
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
The topic ‘Basic PHP help needed’ is closed to new replies.