Custom comments

$args = array(‘post_id’=>get_the_ID(), ‘status’=> ‘approve’); $all_comm = get_comments($args); $per_page = get_option(“comments_per_page”); if(!$per_page) $per_page = 4; $cpage = get_query_var(“cpage”); if(!$cpage) $cpage = 1; if(round(count($all_comm)/$per_page) == 0) $total = 1; else $total = round(count($all_comm)/$per_page); $args_comments = array( ‘base’ => add_query_arg( ‘cpage’, ‘%#%’ ), ‘format’ => “”, ‘total’ => $total, ‘current’ => $cpage, ‘echo’ => false, ‘add_fragment’ => … Read more

Delayed commenting

There isn’t a plugin that I know of. How many comments are we talking about? I’m assuming to many to manually approve. A simple solution I can think of would be adding something like this to the comment loop in comments.php. Find the foreach loop and replace it with something like <?php //set the date … Read more

Query & Sort Comments by custom comment meta

Unfortunately it’s unsupported by the applicable WordPress functions for querying comments, which is primarily due to(i feel) not enough people(or anyone) yet asking for it. I want to highlight a couple of core files here to help understand the issue. First up comments-template.php, the comment_template function, it’s this function that queries for comments and then … Read more

How to override function twentyten_comment

I was working on another part of my website and found the issue. For some reason, child functions.php was not being recognized by wordpress. Mine was listed in the right admin toolbar as ‘functions.php’ not as Theme-functions ‘(functions.php)’ I copied the content, created a new ‘functions.php’ and pasted the contents into the new file; then … Read more

How to add custom comment fields but *only on the comment reply form*?

By using comment_form( $args, $post_id ) you can add extra field in your comment form like this $commenter = wp_get_current_commenter(); $req = get_option( ‘require_name_email’ ); $aria_req = ( $req ? ” aria-required=’true'” : ” ); $fields = array( ‘author’ => ‘<p class=”comment-form-author”>’ . ‘<label for=”author”>’ . __( ‘Name’ ) . ‘</label> ‘ . ( $req … Read more

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