When you add a text widget to a sidebar in Wordpress the widget includes this code
<div class="textwidget">
How do I remove this without editing the core?
FYI - I think this line is located here: wp-includes/default-widgets.php (line 383)
|
If you're looking to remove the actual div with the textwidget class applied to it but not it's content, this is a simple method using jQuery:
|
|||
|
|
|
As per the comment, in the case it is probably better to just remove or replace the class name using jQuery then a php function, since that class is hardcoded anyhow. To remove it.
To set the css to hide it.
To change the class name
|
|||
|
|
You can use output buffering (http://php.net/manual/es/book.outcontrol.php) to get the whole generated page in a variable and remove the offending before echoing. But it seems overly complicated for this case. You can just copy all the widget code and create a new widget (in a plugin or your functions.php) without that hardcoded div. It's really not that much code. Also, any reason to remove that div that can not be solved in css? |
|||
|
|
.remove. – Wyck Jun 12 '12 at 17:34