Commentform input area issue

Try adding the code to the comment-template.php file located in wp-includes, right under the function get_comment_author_link( $comment_ID = 0 ) { /** @todo Only call these functions when they are needed. Include in if… else blocks */ $url = get_comment_author_url( $comment_ID ); $author = get_comment_author( $comment_ID ); if ( empty( $url ) || ‘http://’ == … Read more

Display avatar with comment form?

I’ll answer myself. Add the following somewhere in functions.php or make it into a plugin: add_action( ‘comment_form_logged_in_after’, ‘psot_comment_form_avatar’ ); add_action( ‘comment_form_after_fields’, ‘psot_comment_form_avatar’ ); function psot_comment_form_avatar() { ?> <div class=”comment-avatar”> <?php $current_user = wp_get_current_user(); if ( ($current_user instanceof WP_User) ) { echo get_avatar( $current_user->user_email, 32 ); } ?> </div> <?php }

Wrapping the cancel_comment_reply_link()

The link markup passes through the filter named, guess what, cancel_comment_reply_link. Something along the lines of (not tested): add_filter( ‘cancel_comment_reply_link’, function( $formatted_link ) { return ‘before’ . $formatted_link . ‘after’; } ); It will still get wrapped into <small> in comment_form() later though, which might or might not be relevant and unfortunately seems hard to … Read more

Remove the function which adds nofollow to links in comments

Add this to your plugin file/theme’s functions.php: remove_filter( ‘pre_comment_content’, ‘wp_rel_nofollow’, 15 ); You could then add your own filter to pre_comment_content to use wp_rel_nofollow selectively, based on your criteria. URLs that are automatically made clickable from plain-text urls like example.com aren’t filterable in a way that allows removing of the rel=”nofollow” attribute. The only solution … Read more

Why could my comment_form variable not be working?

This code makes no sense: function my_fields($fields) { $fields[‘new’] = ‘<p>red rover 1</p>’; return $fields; } add_filter(‘comment_form_top’,’my_fields’); I’m not even sure what it’s supposed to do, because comment_form_top is an action, not a filter. If you want to add extra fields, you should be using the comment_form_default_fields filter: add_filter(‘comment_form_default_fields’,’my_fields’); However, this might not work or … Read more

Remove field in the form : only works for “url”, not for “email”?

This works fine for me: <?php add_filter(‘comment_form_default_fields’, ‘wpse53687_filter_fields’); /** * Unsets the email field from the comment form. */ function wpse53687_filter_fields($fields) { if(isset($fields[’email’])) unset($fields[’email’]); return $fields; } One reason that it could be failing on your theme is that args were passed into comment_form. Specifically, the theme author passed in a fields key into the … Read more

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