New answers tagged

0

I'm not completely sure what you are trying to accomplish, but here's what I think. Normally you would generate a link to a comment like this: echo '<a href="' . get_permalink($comment->comment_post_ID) . '#comment-' . (strval($comment->comment_ID)) . '">'; The problem with filtering get_permalink() is that the filter must know that it is ...


2

You should use get_comments( $args ) and add the post ID in the arguments ($args) array: $post_id = 1; // post ID here from the submitted data $comments = get_comments(array( 'post_id' => (int) $post_id )); // dump the comments found print_r( $comments ); That would get you a comments list on that post. Hope that helps.


0

My appologies. I was busy in the content-single.php. I have manged to sort this out by editing the single.php file in my child theme.


2

There's a great article explaining how to hook into 2 filters for this at http://www.sourcexpress.com/customize-wordpress-comment-notification-emails/ To send your notifications to a particular user and not the site admin, try this for a user with ID 123: function se_comment_moderation_recipients( $emails, $comment_id ) { $comment = get_comment( ...


1

You should try to replace <?php comment_reply_link(); ?> with: <?php comment_reply_link( $args ); ?> and to make sure the $args['depth'] is not zero or greater or equal than the $args['max depth']. There will be no output if that's not the case. If that doesn't work, you could try to add the comment ID or the comment object as the second ...


3

Please place below code in your theme's functions.php file and it will wrap the submit button inside div: // define the comment_form_submit_button callback function filter_comment_form_submit_button( $submit_button, $args ) { // make filter magic happen here... $submit_before = '<div class="form-group">'; $submit_after = '</div>'; ...


4

We can use comment_form function's submit_button parameter to change submit button HTML. Default HTML for submit_button is <input name="%1$s" type="submit" id="%2$s" class="%3$s" value="%4$s" /> You can change your code like this. $comments_args = array( .... 'submit_button' => '<div class="form-group"> <input ...


2

Im not aware of any hook that could change only comment notification recipient.. You would probably need to overwrite some kind of core function but here's a small workaround you could use: 1. Disable the email feature from WordPress comments settings (unless you want to get notified too) 2. Send it manually using comment_post action hook, just add this ...


0

Now what if you have to add/remove fields from default contact form to change the feel of your comment box? I am eliminating website field from default comment box by playing with ‘fields’ argument:in comments.php <?php $comment_args = array('title_reply' => 'Got Something To Say:', 'fields' => apply_filters('comment_form_default_fields', ...


0

I believe you can hook your new function to comment_template() like this: add_action('comments_template', 'my_function') or function hide_my_comment_template() { return null; } add_action('comments_template', 'hide_my_comment_template')



Top 50 recent answers are included