Andy Keith
Forum Replies Created
-
Forum: Plugins
In reply to: [Featured Images in RSS for Mailchimp & More] PHP noticesGreat, thanks for letting me know
Forum: Plugins
In reply to: [Better Recent Comments] Custom CSSHi,
Try this:
.recent-comments-list .comment-avatar img { border-radius: 6px; }
Forum: Plugins
In reply to: [Better Recent Comments] Custom CSSGreat! Glad it’s working now.
Forum: Plugins
In reply to: [Better Recent Comments] Custom CSSHi,
I’m not seeing your custom CSS being loaded on that page. Are you sure you’ve added it correctly? You might need to clear any caches you have in place also.
Kind regards,
AndyForum: Plugins
In reply to: [Better Recent Comments] Custom CSSHi,
No problem, your English is perfect ??
Here are the CSS selectors you need:
Author name:
.recent-comments-list .comment-author-link
Post title:.recent-comments-list .comment-post
Comment text:.recent-comments-list .comment-excerpt
Date:.recent-comments-list .comment-date
Kind regards,
AndyForum: Plugins
In reply to: [Better Recent Comments] Show comments, but no repeat from same postFollow up: My previous comment about excluding replies was incorrect. By default, WordPress (see
WP_Comment_Query
) will show both initial comments and replies when fetching comments from the database. To exclude replies, you would need to set theparent
option in the comment query to0
. To do this in our Better Recent Comments plugin, use:add_filter( 'better_recent_comments_comment_args', function( $args ) { $args['parent'] = 0; return $args; } );
Forum: Plugins
In reply to: [Better Recent Comments] Only one comment per postHi,
Thanks for getting in touch. I’ve reviewed the support thread you referred to and the plugin code.
You’re quite right – the plugin shows both initial comments and replies. This is the same whether you use the shortcode or widget as both methods use the same underlying code to retrieve comments. This behaviour mimics the default Recent Comments widget built into WordPress, which also shows both top-level comments and replies.
The reason for the confusion was because my original reply was based on reviewing the WordPress code, specifically the documentation for the
hierarchical
option inWP_Comment_Query
:'hierarchical' - Whether to include comment descendants in the results. 'threaded' returns a tree, with each comment's children stored in a <code>children</code> property on the <code>WP_Comment</code> object. 'flat' returns a flat array of found comments plus their children. Pass <code>false</code> to leave out descendants. Accepts 'threaded', 'flat', or false. Default: false.
In the plugin we do not set the
hierarchical
option when fetching comments, therefore the default valuefalse
is used. I assumed from the documentation therefore that descendent comments (i.e. replies) would be omitted from the results. However my tests have confirmed this is NOT the case and replies are in fact included. So the inline documentation forWP_Comment_Query
is not accurate (or is at least confusing) and I will be passing this on to the WordPress team.Returning to your question, it’s therefore not currently possible to hide comment replies with our plugin. However you could do this by adding some code to your site to filter the comment options passed to
WP_Comment_Query
. By settingparent
to0
you can exclude replies from the results, and only show top-level comments:add_filter( 'better_recent_comments_comment_args', function( $args ) { $args['parent'] = 0; return $args; } );
As we’re now aware of this limitation, we will add this to our feature request list to enable in-built support for this. In the meantime, the only option would be to use the above code.
Kind regards,
Andy- This reply was modified 4 years, 6 months ago by Andy Keith.
- This reply was modified 4 years, 6 months ago by Andy Keith.
Forum: Plugins
In reply to: [WooCommerce Custom Add To Cart Button] ColorHi,
It’s on the list. It makes sense to include this alongside the text and icon modifications. Do you need any information on CSS selectors for the buttons?
Andy
Forum: Plugins
In reply to: [Better Recent Comments] show all of end users comments to them on frontend.Hi,
No it doesn’t have that feature unfortunately. The plugin is basically the same as the default WordPress recent comments, with a few minor enhancements (e.g. avatars).
Forum: Plugins
In reply to: [WooCommerce Custom Add To Cart Button] problem with css designNo problem ??
Forum: Plugins
In reply to: [Posts Table with Search & Sort] Possible to export as CSVHi,
Sorry, it’s not possible to that in the plugin.
Kind regards,
Andy
Forum: Plugins
In reply to: [Better Recent Comments] Include NextGEN photo comments in BRC widgetHi,
In
WP_Comment_Query->get_comments()
, after it fetches the comment IDs, it then primes the cache for those IDs, and uses the result to build the full comments which are returned to the widget. This is the SQL in_prime_comment_caches
:sprintf( "SELECT $wpdb->comments.* FROM $wpdb->comments WHERE comment_ID IN (%s)", join( ',', array_map( 'intval', $non_cached_ids ) ) );
Hope that helps.
Forum: Plugins
In reply to: [WooCommerce Custom Add To Cart Button] problem with css designHi,
WordPress normally adds a ‘home’ CSS class to the <body> tag on the homepage, and ‘archive’ for product archives. So you could try this selector:
.home .add_to_cart_button { // CSS for homepage } .archive .add_to_cart_button { // CSS for archives }
- This reply was modified 4 years, 8 months ago by Andy Keith.
Forum: Plugins
In reply to: [Better Recent Comments] Include NextGEN photo comments in BRC widgetHi there,
We use the core function
get_comments()
to retrieve the comments, so the SQL gets built by WordPress inWP_Comment_Query
. I did a bit of digging in core and this is the SQL which WordPress is using when the Better Recent Comments widget loads:SELECT wp_comments.comment_ID FROM wp_comments JOIN wp_posts ON wp_posts.ID = wp_comments.comment_post_ID WHERE ( comment_approved = '1' ) AND wp_posts.post_status IN ('publish') ORDER BY wp_comments.comment_date_gmt DESC LIMIT 0,5
- This reply was modified 4 years, 8 months ago by Andy Keith.
- This reply was modified 4 years, 8 months ago by Andy Keith.
Forum: Plugins
In reply to: [Better Recent Comments] Include NextGEN photo comments in BRC widgetHi Paul,
That’s strange. I would have thought they would come back from the database if the comment type is blank. As the comments don’t appear in the default WordPress ‘Recent Comments’ widget either, it could be that NextGEN is filtering them out somewhere. Perhaps you could reach out to NextGEN support to see if they can shed any light on it.
Andy