Joy
(@joyously)
You can put a non-breaking space in the Title field instead. Type it as or maybe even a normal space would do it.
Thanks for the reply. I would rather remove it completely if possible?
Joy
(@joyously)
You can copy the core code for the widget and make a new widget with a different name, since I don’t think there are any filters in the widget code.
If you change core code files, your change could be lost when you update to a new WP version.
The core widget code is separate from the code for the core widget blocks (I think).
You can use one of several plugins that provide different Recent Posts widgets.
You could alter a plugin much easier than altering WP itself.
Thanks for the reply.
How would I make a copy of the core widget code? Is this done in the Widgets area?
Joy
(@joyously)
You would go to wp-includes/widgets and copy the file class-widget-recent-posts.php to your child theme or a plugin folder.
Edit it and change the class name (or it will give a fatal error of duplicate definition). And change the title to your preference (no title).
To be able to use your widget, you will need to register it. Use the new class name as the parameter.
function mynew_widgets_init() {
register_widget( 'myNewClass_Recent_Posts_Widget' );
}
add_action( 'widgets_init', 'mynew_widgets_init' );
Be sure to load your new widget code, so it gets defined. (It’s different for plugin vs. theme.)
Thank you for that, I will try that 🙂