WP Custom Comment Callback Not Responding

There is apparently some sort of query call that takes place as part of the comments_template() call, just as there is with loop calls. When I put my custom function in the comments template, it works perfectly. I tried putting the entire contents of the comments template into my custom loop-single template, and it didn’t … Read more

Problem display only posts with comments

your query doesn’t restrict posts without comments. $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1; query_posts( ‘cat=-8378, -13444&orderby=comment_count&paged=’ . $paged ); while (have_posts()) : if( get_comments_number() ) the_post(); […] reference: get_comments_number()

How to display comments list by order when clicking on newest or oldest link?

Just open the comments.php file from your theme. Find the following line (or similar) <?php foreach ($comments as $comment) : ?> Add this lines just above it if (isset($_GET[‘comOrder’]) && $_GET[‘comOrder’] == ‘Newest’ ) $comments = array_reverse($comments, true); so your code looks like this: <?php if (isset($_GET[‘comOrder’]) && $_GET[‘comOrder’] == ‘Newest’ ) $comments = array_reverse($comments, … Read more

WordPress error when sending comment

I’m using the “comments_template()” function with no additional parameters, which loads the default “comments.php” from the wp-includes library. That’s your problem. The compat version is unmaintained and obsolete. Theme-compat files are officially no longer supported, as of WordPress 3.0. (See here.) You need to define and include comments.php in your Theme.

Use specific language for comment section

On the bottom of comments.php I use the following code: <?php comment_form(array(‘comment_field’ => ‘<p class=”comment-form-comment”><label for=”comment”>Comment</label><textarea id=”comment” name=”comment” cols=”45″ rows=”8″ aria-required=”true”></textarea></p>’, ‘comment_notes_before’ => ‘<p class=”comment-notes”>Your email address will not be published. Required fields are marked *</p>’, ‘comment_notes_after’ => ”, ‘title_reply’ => ‘Leave a Reply’, ‘title_reply_to’ => ‘Leave a Reply to %s’, ‘label_submit’ => ‘Post comment’, … Read more

same comment list for two posts

You could use get_comments() instead. The code in this forum post gives an example of how you’d do that: <?php $recent_comments = get_comments( array(‘post_id’ => $newest_post_id,) ); foreach ($recent_comments as $comment) { ?> <?php $comment_id = get_comment($comment->comment_ID); $author = $comment_id->comment_author; $commentdate = $comment_id->comment_date; $content = $comment_id->comment_content; ?> <p><?php echo $author; echo $commentdate;?></p> <p><?php echo $content;?></p> … Read more

Comment Function

the function you posted is limited to 5 comments which means it should work, but anyway there is no need for a custom SQL query when you can use the native get_comments function function showLatestComments() { $comments = get_comments(array( ‘status’ => ‘approve’, ‘number’ => ‘5’ ) ); $output .= ‘<h2>Latest student perspectives <img src=”https://wordpress.stackexchange.com/wp-content/themes/blue-and-grey/images/hmepage-tri.png” class=”class3″ … Read more

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