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

Where is the comment response form template? #5

Closed
lonchbox opened this issue Feb 28, 2012 · 6 comments
Closed

Where is the comment response form template? #5

lonchbox opened this issue Feb 28, 2012 · 6 comments

Comments

@lonchbox
Copy link

Hi,

Thanx for developing this I really liked, but I hava a problem, where is the comment form template?, I mean, the

response, I dive and dive but couldn't find it :P

Thanx.

@philiparthurmoore
Copy link
Collaborator

I'm not sure what you're asking. Do you mean a custom comment form callback function? comments.php houses the code for the comment template and inc/template-tags.php has the function that actually handles the comment form markup (look for _s_comment in that file).

@mfields
Copy link
Contributor

mfields commented Feb 29, 2012

The comment form is generated by a template tag:

<?php comment_form(); ?>

This function accepts many arguments to modify it's output. There are also a slew of hooks that you can use. Read more about it in the codex: http://codex.wordpress.org/Function_Reference/comment_form

@lonchbox
Copy link
Author

Thanx guys, I got the point. Could be nice idea to have the complete response form as a template tag inside of template-tag.php.

@mfields
Copy link
Contributor

mfields commented Feb 29, 2012

No Problem, glad we could help. Just to clarify, the comment_form() function is used to ensure that themes built from _s will adhere to the guidelines defined by The WordPress Theme Review Team. If you visit http://codex.wordpress.org/Theme_Review#Functionality you will notice that use of comment_form() is required to generate the form that displays under the comment list.

@philiparthurmoore
Copy link
Collaborator

Sorry for prematurely closing this. Thanks for adding in your comment, mfields. Didn't want to seem like I was ignoring lonchbox! :)

@lonchbox
Copy link
Author

lonchbox commented Mar 1, 2012

No problem @philiparthurmoore :)

To made my own form I use this code
<?php if(comments_open()) : ?> <?php if(get_option('comment_registration') && !$user_ID) : ?> <p>You must be <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php echo urlencode(get_permalink()); ?>">logged in</a> to post a comment.</p><?php else : ?> <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform"> <?php if($user_ID) : ?> <p>Logged in as <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=logout" title="Log out of this account">Log out &raquo;</a></p> <?php else : ?> <p><input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="22" tabindex="1" /> <label for="author"><small>Name <?php if($req) echo "(required)"; ?></small></label></p> <p><input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" /> <label for="email"><small>Mail (will not be published) <?php if($req) echo "(required)"; ?></small></label></p> <p><input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" /> <label for="url"><small>Website</small></label></p> <?php endif; ?> <p><textarea name="comment" id="comment" cols="100%" rows="10" tabindex="4"></textarea></p> <p><input name="submit" type="submit" id="submit" tabindex="5" value="Submit Comment" /> <input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" /></p> <?php do_action('comment_form', $post->ID); ?> </form> <?php endif; ?> <?php else : ?> <p>The comments are closed.</p> <?php endif; ?>
It´s Correct?, why is not inside of the template tag? In my case I wan´t to add new fields and change the design using new classes on the html not only the css.

CostyEffe referenced this issue in silverbackstudio/wp-theme Jun 23, 2020
Add SCRIPT_DEBUG constant to allow loading of optimised CSS/JS.
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

3 participants