How to add attributes to the comment form tag?
Use this function rather than comment_form() function validate_comment_form(){ ob_start(); comment_form(); echo str_replace(‘<form’,'<form attribute=”value” ‘,ob_get_clean()); }
Use this function rather than comment_form() function validate_comment_form(){ ob_start(); comment_form(); echo str_replace(‘<form’,'<form attribute=”value” ‘,ob_get_clean()); }
All comments are just listed under “Comments” there is no attribute or parameter which creates a seperate “Comments” section/page for your custom post-type. Atleast not that I know of. However, you could add a filter to the comments list, to filter all comments based on post-types. It will be just like a category filter in … Read more
You can change the preference from settings. Navigate to Settings > Discussion page on your wp-admin Find Automatically close comments on articles older than and uncheck that option. That should solve your problem.
Actually it’s there within WordPress by Default. If your WordPress editor is not showing it, then from the top left corner, click the Screen Options drop down menu. It’ll show some check boxes. Among those, there is one called Discussion. If you check that, then WordPress will show the option Allow Comments after the editor … Read more
If in the root of the folder of your theme there is no file “comments.php”. Than comments_template () include the file from the path “/wp-includes/theme-compat/comments.php”. To make changes in that file you can copy “comments.php” from this folder to the root of your theme. And then change as you like.
This option is used to output a pingback comment. It’s passed to the Walker_Comment class, and if it’s set to true, it will output something similar to this: <li> <div class=”comment-body”> Pingback: <a href=”https://wordpress.stackexchange.com/questions/348102/author-url-here” rel=”external nofollow” class=”url”>Author Name</a> </div> The author URL is the field that users enter when filling out the comment form. Note … Read more
I figured it out. Each comment row in the wp_comments table has a field named comment_parent which stores the comment_ID of the parent comment. If the comment has no parent, then the default is 0. So I guess on each comment post I would check the database for the posted comment’s parent, and if it … Read more
wp_get_current_commenter() returns an array, the entry ‘comment_author’ stores the name: Array ( [‘comment_author’] => ‘Harriet Smith, [‘comment_author_email’] => ‘hsmith@,example.com’, [‘comment_author_url’] => ‘http://example.com/’ ) More information is available in the codex. Update To find the nice name, ask the DB: /** * Searches the user table by display name. * @param string $display_name * @return object … Read more
Use $comment->comment_post_ID instead of $comment->post_id. Also you don’t need get_post(…). Just use get_the_title instead of your $post_obj and related code…
use the follow var: $comment->comment_approved and check for the value <?php if (0 == $comment->comment_approved) { ?> <em><?php _e(‘Your comment must approved.’, FB_BASIS_TEXTDOMAIN) ?></em> <?php } ?> code example: http://code.google.com/p/wp-basis-theme/source/browse/trunk/basis/comments.php