Facebook plugin shows existing comments

I don’t use this plugin, but it looks like this comment template is loaded with add_filter( ‘comments_template’, array( ‘Facebook_Comments’, ‘comments_template’ ) ); The simplified structure of this comment template looks like: if ( have_comments() ) : // … wp_list_comments( $_comment_options ); // … endif; $_facebook_comments = Facebook_Comments::comments_box(); if ( $_facebook_comments ) { do_action( ‘facebook_comment_form_before’ ); … Read more

Highlighting the current users comment

assumes that your theme is using comment_class(); example (to be added to functions.php of your theme): add_filter( ‘comment_class’, ‘comment_class_logged_in_user’ ); function comment_class_logged_in_user( $classes ) { global $comment; if ( $comment->user_id > 0 && is_user_logged_in() ) { global $current_user; get_currentuserinfo(); $logged_in_user = $current_user->ID; if( $comment->user_id == $logged_in_user ) $classes[] = ‘comment-author-logged-in’; } return $classes; } requires … Read more

How to remove comment link title attribute?

The title attribute is hard-coded in comments_popup_link() unfortunately: echo ‘ title=”‘ . esc_attr( sprintf( __(‘Comment on %s’), $title ) ) . ‘”>’; What you can do is catching the generated HTML in a variable and replacing the attribute with an empty string: ob_start(); comments_popup_link(); print preg_replace( ‘~ title=”[^”]+”~’, ”, ob_get_clean() );

Auto-fill Custom comment fields

You can store these values in cookies and fill them when you are creating form inputs. So in save_comment_meta_data add something like this: $commenter_data = array( ‘phone’ => $phone, … ); setcookie(‘commenter_data’, serialize($commenter_data), time()+1209600, COOKIEPATH, COOKIE_DOMAIN, false); And then when you’re creating form: $commenter_data = isset($_COOKIE[‘commenter_data’]) ? unserialize($_COOKIE[‘commenter_data]) : array(); echo ‘<p class=”comment-form-title”>’. ‘<label for=”phone”>’ … Read more

How to load javascript file on homepage in WordPress in order?

In your functions.php: edit: First register the quicktags script under a different name than already registered in wp “quicktags” , see Codex function quicktags_script() { wp_register_script( ‘quicktags-min’, ‘/wp-includes/js/quicktags.min.js?ver=3.5.1’,”,”,true); wp_enqueue_script( ‘quicktags-min’ ); } add_action( ‘wp_enqueue_scripts’, ‘quicktags_script’ ); This will load the script for all the pages on your front-end. To load it only on front-page : … Read more

Load comments.php template outside the post loop

So apparently this is a big no-go, but I’ve been able to build my own custom comments form and loop using this code: <?php $args = array( ‘post_id’ => $post_ID); $comments = get_comments($args); if($comments) : foreach($comments as $comment) :?> <div class=”comment”><?php print_r($comment); ?></div> <?php endforeach; endif;?>

How can I get a list of comments by target

When it comes to retrieve posts, it’s supposed to call WP_Query. WP_Query has an argument called meta_query but it doesn’t have comment_query. So it might need a trick to achieve what you want, $args = array(); $args[‘feed’] = 1; $args[‘withcomments’] = 1; $args[‘author’] = 1; //author id. $query = new WP_Query($args); $posts = $query->posts; //do … Read more

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