How to change commenter links to /user/user_id?

You can use the get_comment_author_link hook, which is part of the get_comment_author_link() template tag, like your question already suggests. Then you only have to get the according user_id, which can be done via the $comment global, and construct the link you want accordingly. Exemplary usage like shown below: add_filter( ‘get_comment_author_link’, ‘wpse144835_custom_comment_author_link’ ); function wpse144835_custom_comment_author_link( $link … Read more

oEmbed does not work for comments

You can use the oEmbed in Comments plugin. This is the code the author, Evan Solomon, uses in this plugin, I used it on a site a while back just copy it in your themes functions file or even better, download his plugin ๐Ÿ™‚ class ES_oEmbed_Comments { function __construct() { add_action( ‘init’, array( $this, ‘init’ … Read more

Add Div to Comment Form

If you want to add some custom HTML between the </h3> and the <form> tags, you can try the following: /** * Add custom HTML between the `</h3>` and the `<form>` tags in the comment_form() output. */ add_action( ‘comment_form_before’, function(){ add_filter( ‘pre_option_comment_registration’, ‘wpse_156112’ ); }); function wpse_156112( $comment_registration ) { // Adjust this to your … Read more

Redirect to page 2 after comment

After reading a bit on regex and preg, starting from a previous example of a similar problem and testing it I was able to answer my own question. I added this function to functions.php: <?php /** Plugin Name: WPSE (#167237) Redirect after comment */ add_filter(‘comment_post_redirect’, ‘redirect_after_comment’); function redirect_after_comment($location) { return preg_replace(“/comment-page-([\d]+)\/#comment-([\d]+)/”, “2”, $location); } It’s … Read more

Get a List of All Commenters on the Current Post

get_comments do not get a post ID as parameter but rather an array in which you can set all kinds of query criteira including post ID. See the codex http://codex.wordpress.org/Function_Reference/get_comments. You can even use the author_email parameter to make get_comments do most of the work for you.

Show comments in a popup

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 comments_popup_script(). In general, you can … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)