HTML markup differs from the default wp-widget-text
-
Your widget plugin is simple but very useful and I like the fact of you add a custom post to manage the text widgets.
I just want suggest you mimic the markup of the default “wp-widget-text”. The default widget wraps the text content in a block that provides the ability to style this block.
You can check the default wp-widget-text file at line 68 (wp-includes/widgets/class-wp-widget-text.php):
<div class="textwidget"><?php echo !empty( $instance['filter'] ) ? wpautop( $text ) : $text; ?></div>
I modified your class-widget.php file line 47 to add the wrapper as:echo '<div class="textwidget">'; echo $content; echo '</div>';
The drawback is when you’ll update your plugin, I have to hack your code again ??
Of course, I don’t urge you to do this!
- The topic ‘HTML markup differs from the default wp-widget-text’ is closed to new replies.