Hide empty widget
-
First i thought it was my theme, but it is the same problem even with one of the default WP themes.
I searched for 1-2 days and found nothing.
Situation is very simple.
– Use Text widget with PHP support
– Put some PHP code inside to display dynamically some content from Post you are viewing
– If there is no content widget display header, widget title and empty box beneath.
– In source code there is absolutely nothing, not even non-braking empty space. Only few pure div classes with nothing inside.Now, such problem i fixed with CSS3 and hide empty DIVs, but i need and have to have widget title, and it is making it impossible to hide with CSS3.
Want to ask is it normal behaviour of WP ?
And is there some code snippet to fix that ?Can say that it has nothing to do with PHP code inside widget. Tested with pure default text widget and empty widget shows.
- The topic ‘Hide empty widget’ is closed to new replies.