Can’t check “Allow people to post comments on new articles” option
Can’t check “Allow people to post comments on new articles” option
Can’t check “Allow people to post comments on new articles” option
My bad. Should have added a foreach for the replies as well. <?php $args = array( ‘user_id’ => $curauth->ID, ‘number’ => 5, ‘status’ => ‘approve’, ‘parent’ => 0 ); $comments = get_comments($args); if ( $comments ) { foreach($comments as $c){ echo ‘<ul id=”authorcomments”>’; echo ‘<li>’; echo ‘<a id=”authorcommentlink” href=”‘.get_comment_link( $c->comment_ID ).'”> ‘; echo get_the_title($c->comment_post_ID); echo … Read more
You can get the title of a post if you have the post ID and every comment is assigned to a post ID. So basically, just use the comment_post_ID + get_the_title() function: get_the_title($c->comment_post_ID);
You should not have the () on the callback field. You shouldn’t need the add_action so remove add_action(‘load_comments’, ‘custom_comments’); And try: wp_list_comments(‘type=comment&callback=custom_comments’); Also, you should extract the $args so they are available in your function: function custom_comments($comment, $args, $depth) { $GLOBALS[‘comment’] = $comment; extract($args, EXTR_SKIP); //etc http://codex.wordpress.org/Function_Reference/wp_list_comments
get_comments() returns empty array if called through AJAX
Yes it is possible but not exactly trivial or well documented. The easiest option is to have different comment types (ie, have new ones in addition to the traditional comment, pingback and tracback). The biggest problem with this approach is that most of wordpress API and admin is not built to be flexible enough to … Read more
In your regex there is a space before the # $mh_regex = “/\ #[a-zA-Z0-9-]+/”; so it would match # tag instead of #tag. It might be a good idea to test your regex using this online tool: http://www.regexr.com/ it’s really usefull for testing
I think that a good way to get what you are trying to do is to use comment__not_in argument of get_comments() function. Send the IDs of the comments currently being displayed in the Ajax request and use them in the comment__not_in argument. For example, you could send those IDs as comment__not_in[] query var (array format): … Read more
Thanks to the theme developers for helping me fixing it. I’m posting the answer here in hope that it may helpes any person facing the same problem. In functions.php there was a code to disable comments on page.php Remove this part of code from functions.php to make the comments working on pages too: function default_comments_off( … Read more
How to change comment-page-1#comment-25 to any string?