Remove Whitespace from empty titles of widgets on sidebar
-
I added a second widgetized sidebar to a theme and I am trying to figure out how to remove the whitespace from a widget that doesn’t have a title. In the functions php I added this code:
register_sidebar( array( 'id' => 'left', 'name' => __( 'left' ), 'description' => __( 'Left Sidebar' ), 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h3>', 'after_title' => '</h3>' ) );
and I because of the h3 tags it appears to be just trying to keep the space open for a title regardless of if there is one on the widget. If I place the title onto the widget it shows up and fills the whitespace. For this theme, I would like to have some sort of if statement in place that detects the presence of a title before proceeding to reserve that space so that the theme comes out clean.
Does anyone have a clue on how to implement that? I have no idea where to start or what syntax would be needed.
Thanks in advance.
- The topic ‘Remove Whitespace from empty titles of widgets on sidebar’ is closed to new replies.