Tag Info

New answers tagged

0

Use my way <?php $commentscount = get_comments_number(); if($commentscount == 1): $commenttext = 'comment'; endif; if($commentscount > 1 || $commentscount == 0): $commenttext = 'comments'; endif; echo $commentscount.' '.$commenttext; ?> its working in all version.


0

You can use facebook's graph API to write a script that will import the comments from facebook into your site. Then Disqus can import your comments from the site. This is the api instructions for getting comments. Alternatively, it looks like someone has already written a plugin that does this though they charge.


1

Does anyone know why this 'comment_post' hook doesn't seem to work!? ... When a comment is posted, the function is not triggered... at all? The hook works. Try the following, it works: add_action( 'comment_post', 'test_notify' ); function test_notify($args , $args2) { echo 'It works!'; die; } As does this: add_action( 'comment_post', ...


0

The problem You must remember to call the core function wp_reset_postdata(), after your while loop, to restore the global $post object. The comment form is relying on that object, that you override with your $queryPosts->the_post() call. Note that the extract() isn't recommended, check this answer by @toscho, for example. Removing comments To remove ...


1

You're re-inventing the wheel here ;-) The Problem You're bypassing WordPress with this approach, so that's explains the error message. Accessing any custom file, within your theme directory, will not load WordPress core automatically. Already available This is already supported by the WordPress core. You should check out comments_popup_link() and ...


0

You are missing 2 parameters in your function report_spam. Also the priority should not be 1. Try the code below. add_action('transition_comment_status', 'report_spam', 10, 3); function report_spam($new_status, $old_status, $comment){ if($new_status == 'spam'){ var_dump($comment->comment_author_IP); die; } } I've set die so ...


0

content-single-product.php sounds like a woocommerce template, which is located here wp-content/plugins/woocommerce/templates. You can override this template in your theme or child them by creating a file wp-content/themes/your-theme/woocommerce/content-single-product.php.



Top 50 recent answers are included