Tag Info

New answers tagged

1

I found out why the two textareas were showing up: The comment_field is not supposed to be in the 'fields' array because it is a distinct parameter for the comment_form() function. It should be: 'url' => '<div class="grid-1-3">' . '<input id="url" placeholder="Website (optional)" name="url" type="text" value="' . esc_attr( ...


1

I think you can use get_comments. In the type parameter you can pass the type of comment (trackback, ping), you can filter by status, and you have a parameter called count, that when is set to true returns just the number of comments that match the parameters you passed. get_comments( array( 'status' => 'approve', 'post_id'=> ...


1

For that matter, don't use comments_popup_link(). Use comments_number() instead. This has the same function but not linked. <?php comments_number( 'no responses', 'one response', '% responses' ); ?>


0

That's problem with your css. Add this in your style.css. ul.children { margin-left: 3em; }


0

If we want to avoid any filters and manual SQL queries, we could try (untested): $args = array( 'post_type' => 'foods', 'posts_per_page' => 5, 'post__in' => array_unique( wp_list_pluck( get_comments( array( 'user_id' => get_current_user_id() ) ), ...


-1

use it for comment number <?php comments_number( 'no responses', 'one response', '% responses' ); ?>


0

You will have to use this function in loop. "Displays the total number of comments, Trackbacks, and Pingbacks for the current post. This tag must be within The Loop." And also you will need to use this. <?php comments_number( '0', '1', '%' ); ?> Replace it with yours <?php comments_number( $zero, $one, $more ); ?>


0

Remove .even & .odd class styles from style.css and use CSS psudo classes. .comment:nth-child(2n) { your styles for even } .comment:nth-child(2n+1) { your styles for odd }


0

If the person commenting is already logged in you could capture the user object like so $user = wp_get_current_user(); and then simply grab the username like $user->user_login. Once you have this it shouldn't be too hard to add in to the creation of a comment so its only asking for the username alone and only once logged in.


0

Not exactly sure which text you are referring to but one of these may help or at least give you some idea: add_filter( 'comment_author_says_text', 'sp_comment_author_says_text' ); function sp_comment_author_says_text() { return 'author says'; } add_filter( 'comment_form_defaults', 'sp_comment_form_defaults' ); function sp_comment_form_defaults( ...


0

You can simply delete them all for the first time and make your WordPress spam prof by tweaking the basic settings. WordPress has an advanced configuration for handling comments. Alternatively, you can utilize some plugins like Akismet to automatically detect and destroy spam comments from your WordPress blog. You can also copy and paste the code below to ...


0

Wordpress, by default don't enable comments on custom post types, and once you have added support for comments, you still get the following message: Comments are closed You have to basically manually visit each custom post and enable comments in the post editor screen. There are however a workaround to enable comments by default in bulk. You can use the ...



Top 50 recent answers are included