In list with recent coments – only show one comment per page/post (latest comment)

First you should KNOW all different posts with comments: global $wpdb; $SelectSQL = “SELECT DISTINCT `comment_post_ID` FROM {$wpdb->comments} LIMIT 0, 15”; $Rows = $wpdb->get_results($SelectSQL); then for each of these posts get the latest comment: foreach($Rows as $row): $comment = get_comments(array(‘post_id’=>$row->comment_post_ID, ‘number’=>1, ‘status’=>’appprove’)); $comment = $comment[0]; … and continue with the display of comment, hope you … Read more

Show count of all comments by meta_value from a users posts

Take a look at the arguments you’re passing to get_comments() and compare them to the documentation on the WordPress Codex. Your example – $args = array( ‘include’ => $postids, ‘meta_query’ => array( array( ‘key’ => ‘viewed_status’, ‘value’ => ‘unseen’ ) ), ‘count’ => true ); The codex example – $defaults = array( ‘author_email’ => ”, … Read more

approve,spam,trash etc. options are not coming on comments in admin panel

I found a way to hijack the comment before it’s attached to its post in the DB. Using the snippet below you can attach every comment to your dummy post. Just change COMMENT_ID to the ID of your dummy post. No hacking of core needed! <?php add_filter(‘preprocess_comment’, ‘akt_hijack_comment’); function akt_hijack_comment($comment) { define(‘AKT_REDIRECT_URL’, $comment[‘comment_post_ID’]); $comment[‘comment_post_ID’] = … Read more

How do I get the comments section to show up?

if you look in the twentyTwelve theme. you can see how they get the comments. Look in the full-width.php file and you can see this code <?php comments_template( ”, true ); ?> this will call the code to get your comments section. Now you must make sure that your theme has the comments.php. You can … Read more

Recent comments per tagged post?

As Konstantin Kovshenin pointed out in this article, you can get the comments for a specific Category like that: <?php $show_comments = 10; $i = 0; $comments = get_comments(“number=50&status=approve”); foreach ($comments as $comment) { $comm_post_id = $comment->comment_post_ID; if (!has_term( ‘XYZ’, $comm_post_id );) continue; $i++; // Output the comment, author and whatever you need // I’ll … Read more

Passing user meta through comment form

If you look in your theme’s comments.php file, you should see a call to wp_list_comments. If that has a callback parameter– something like this array( ‘callback’ => ‘twentyeleven_comment’ )— then your theme has its own comment display function. Find that function. It is probably in function.php but no promises. If not, you need to make … Read more

WordPress is adding above html

I would suggest you to search for files by content and search inside wp-content folder of your WordPress for this string: “page-who-we-are.php” – you’ll locate the string and you can remove it. To search files by content on Windows, see Best way to confidently search files and contents in Windows without using an indexing service?

different levels of nested comments per page

Please reference the Codex entry for wp_list_comments(). This function includes a ‘max_depth’ parameter in its args array. On the specific page in question, simply call: <?php wp_list_comments( array( ‘max_depth’ => ‘1’ ) ); ?> If you need more specific help, please clarify your question to indicate how you would identify the specific page in question. … Read more

modifying the comment form

That function is called directly in a theme, probably in comments.php. Remove the function call there, and use your own function with a different name. Be aware many plugins rely on the code in the native function. If you change too much, some plugin might break. You can edit the label element with a filter … Read more

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