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

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

Wrong gravatar showing up?

If you go to http://gravatar.com/d6b10d5767d1e29006c11e1a2c590f3c (omit the /avatar/ from path) you get http://gravatar.com/clojita which seems to be your gravatar account, correct? MD5 collision is unlikely (but maybe it’s time to buy a lottery ticket 🙂 Look at source fetches interesting detail — the comment in question has comment-author-clark class. So it’s not only the gravatar … Read more

What is comment_karma?

You get the comment_karma property because there is such a column in the comments table. It is meaningless and AFAIK was never used for anything except for maybe some random spam prevention plugin. It is there just for backward compatibility and because no one thinks that removing it will improve anything in a measurable way. … Read more

Comments to Custom Post Type

Please try: $args = array( ‘posts_per_page’ => -1, ‘post_type’ => ‘thread’ ); $thread_posts = get_posts( $args ); // Get all posts of thread. foreach($thread_posts as $thread_post_object) { /*not sure really need to be working IDs only, but is simpler, plus made checking was getting right ones easier */ $thread_post_IDs[] = $thread_post_object->ID; } foreach ($thread_post_IDs as … Read more

Altering the pingback functionality

Actually, it turned out quite easy, as the post can be retrieved from the slug: // get the url of the reffering post $ping_slug = $comment->comment_author_url; // keep just the slug $ping_slug = trim(parse_url($ping_slug, PHP_URL_PATH), “https://wordpress.stackexchange.com/”); // get the post from the slug $ping_post = get_page_by_path($ping_slug, OBJECT, ‘post’); // find the post author data $ping_author … Read more

Add a custom class to awating comments

Here’s one way to add a custom .wpse-comment-awaiting-moderation comment class through the comment_class filter: add_filter( ‘comment_class’, ‘wpse_259326_comment_classes’, 10, 5 ); function wpse_259326_comment_classes ( $classes, $class, $comment_ID, $comment, $post_id ) { if( ‘unapproved’ === wp_get_comment_status( $comment ) && is_array( $classes ) ) $classes[] = ‘wpse-comment-awaiting-moderation’; return $classes; } where we used that wp_get_comment_status( $comment ) returns … Read more

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