How to open up comments to all visitors
Go to yoursite… /wp-admin/options-discussion.php Is Users must be registered and logged in to comment selected? If so, unselect it and Save Changes.
Go to yoursite… /wp-admin/options-discussion.php Is Users must be registered and logged in to comment selected? If so, unselect it and Save Changes.
I found a solution to add rel=”nofollow” to comments. My theme maker gave me this hack that you can add in functions.php (no guarantee it will work for everyone, might depend on your theme): function add_nofollow_to_comments_popup_link() { return ‘ rel=”nofollow” ‘; } add_filter( ‘comments_popup_link_attributes’, ‘add_nofollow_to_comments_popup_link’ );
You can not enable comments in future posts. Those posts are not public and are not private, so they verify the conditional in line 61 of wp-comments-post.php file; that conditional is (WP 4.1.1): } elseif ( ! $status_obj->public && ! $status_obj->private ) { /** * Fires when a comment is attempted on a post in … Read more
If you mean, the last 5 comments on anything: $comments = get_comments( array( ‘count’ => 5 ) ); foreach( $comments as $comment ) { echo get_comment_link( $comment ); } For a specific post or page comments, just change the $comments line to: $comments = get_comments( array( ‘post_id’ => 1, ‘count’ => 5 ) ); // … Read more
Generally comments are being displayed using comments.php, the template is rendered using a function called comments_template();. If- there is a comment template in your theme and it contains a function called comment_form(), and the comment template is being displayed below the post (in single.php, page.php etc.), and your comment settings from the Admin panel is … Read more
Try editing category.php – or category-news.php if you have it – your CSS seems to indicate you’ve created a “news” category, but you’ll hopefully know which files you’ve edited – and adding: $withcomments = 1; // If comments are open or we have at least one comment, load up the comment template. if ( comments_open() … Read more
You need to 301 redirect the old URLs. This can be done by using Custom Permalinks plugin which automatically updates the 301 version of the URL and thus helping the Facebook plugin to recognise and restore the likes and comments.
It’s strange that you want to use comments pagination where the comment links are without the comments pagination base. But you can try this (untested): /** * Remove the comments pagination base from comments links */ ! is_admin() && add_filter( ‘get_comment_link’, function( $link, $comment, $args ) { if( $args[‘per_page’] ) $link = sprintf( “%s#comment-%d”, get_permalink( … Read more
They are pretty much the same. You really can’t say one is better. One has a specific and the other one a more general purpose – that is it. Personally I tend to go with the specific ones, but that is only a personal preference. In summary, just chose which one you want to use. … Read more
Does anyone know why this ‘comment_post’ hook doesn’t seem to work!? … When a comment is posted, the function is not triggered… at all? The hook works. Try the following, it works: add_action( ‘comment_post’, ‘test_notify’ ); function test_notify($args , $args2) { echo ‘It works!’; die; } As does this: add_action( ‘comment_post’, ‘test_notify’ ); function test_notify($args … Read more