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()

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

How do I separate author avatars and comments in 3.4.2?

Ok, so this is what I’ve done. If anybody has a better idea I will leave the answer open for a few hours and choose it! <?php if($comments) : ?> <ol> <?php foreach($comments as $comment) : ?> <li id=”comment-<?php comment_ID(); ?>”> <?php if ($comment->comment_approved == ‘0’) : ?> <p>Your comment is awaiting approval</p> <?php endif; … Read more

Actual comments not showing, but form is?

Your format looks a bit off to me. I’d try it more like this: <?php $fields = array( ‘author’ => ‘<p><label for=”author”><span class=”req”>* </span>’ . __( ‘Name’ ) . ‘</label><input id=”author” name=”author” type=”text” value=”‘ . esc_attr( $commenter[‘comment_author’] ) . ‘” size=”30″‘ . $aria_req . ‘ /></p>’, ’email’ => ‘<p><label for=”email”><span class=”req”>* </span>’ . __( ‘Email’ … Read more

By Default, Turn Comments Off for Pages & Leave Comments On for Posts

Hook into wp_insert_post, check if it is an auto-draft for a page, and set the comment_status to closed: add_action( ‘wp_insert_post’, ‘t5_disable_default_comments_on_pages’, 10, 2 ); function t5_disable_default_comments_on_pages( $post_ID, $post ) { remove_filter( current_filter(), __FUNCTION__ ); if ( ‘auto-draft’ !== $post->post_status or ‘page’ !== $post->post_type ) return; $post->comment_status=”closed”; wp_update_post( $post ); }

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