X

Remove widget title

Add this to the functions.php file of your theme. When adding any widget, if you begin the title with an exclamation point (bang) ! it will hide the title when output on your site. Very useful if you want to show the title of a widget in the control panel, but not have it output on the front end of the site.

This snippet is re-purposed from a WordPress plugin called Remove Widget Titles.

Code Snippet:

<?php
// REMOVE WIDGET TITLE IF IT BEGINS WITH EXCLAMATION POINT
add_filter( 'widget_title', 'remove_widget_title' );
function remove_widget_title( $widget_title ) {
	if ( substr ( $widget_title, 0, 1 ) == '!' )
		return;
	else 
		return ( $widget_title );
}
?>

Comments  Leave a Reply

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

WordPress Launch Checklist

The Ultimate WordPress Launch Checklist

We've compiled all the essential checklist items for your next WordPress website launch into one handy ebook.
Yes, Send Me the Free eBook!