Learned how to remove Post Author comments from Recent Comments Widget
2
Hi all,
Today I learned how to Remove Author from Recent Comments Widget and would like to share it:
If your WordPress blog displays a Recent Comments widget on the sidebar or on any widget area, you may want to hide your own ( Post Author ) comments or replies from the list. There’s no need to edit core WordPress files. You can use the widget_comments_args filter.
- Go to your Dashboard
->
Appearance <code>-> Editor - Select your functions.php ( it is recommended that you do this on a child theme )
- Add the code below (in Bold) above the // END ENQUEUE PARENT ACTION then click save.
- function ra_recent_comments_less_author( $array ) { global $post; $array['user_id'] = !$post->post_author; return $array; } add_action( 'widget_comments_args', 'ra_recent_comments_less_author' );
- Your screen should look like this:
Source: http://ronangelo.com/remove-author-from-recent-com...
I followed the steps and it worked!
I don't see may name under the Recent comments widget anymore. Yay!
Regards,
Dira
Create Your Free Wealthy Affiliate Account Today!
4-Steps to Success Class
One Profit Ready Website
Market Research & Analysis Tools
Millionaire Mentorship
Core “Business Start Up” Training
Recent Comments
2
Create Your Free Wealthy Affiliate Account Today!
4-Steps to Success Class
One Profit Ready Website
Market Research & Analysis Tools
Millionaire Mentorship
Core “Business Start Up” Training
Thanks for sharing