Ron Hendriks
asked 6 years ago

The header of the DW sidebar Widgets like Recent news have a black top bar and a white font.
Other widgets, like the original WordPress text widget, have just a capital black font as a header.
Is it possible to give all sidebar widget top bars the same (black) look?
 

3 Answers
DominicStaff
answered 6 years ago

Hello Ron !
If you want to Text widget in the sidebar widget top bars the same (black) look as the Recent news widget, you can open the default-widgets.php file in the folder path “\wp-includes\default-widgets.php”. Find the line 394. 
Replace the following code: 

$widget_ops = array('classname' => 'widget_text', 'description' => __('Arbitrary text or HTML.'));

With new code :

$widget_ops = array('classname' => 'widget_text latest-news', 'description' => __('Arbitrary text or HTML.'));

Notice: You just need to add the “latest-news” class to the line code of the widget that your want to change color.
Hope this helps !

Ron Hendriks
answered 6 years ago

Thanks so far. tried to figure out how to add class to the line code of the widget, but sorry, could not find out how.
By the way: is n’t possible to make the change in de css file? By copying the widget_text latest news properties in in the widget_text properties?
(And here is where I use your very nice template: http://www.verkeersnet.nl)
 

DominicStaff
answered 6 years ago

Hi Ron ! 
You can add the following code to the Header Code (Dashboard > Appearance > Customize > General Setting)

<style>
#secondary .widget.widget_text .widget-title {
background:#000000;
color: #FFF;
position: relative;
text-align: center;
}
#secondary .widget.widget_text .widget-title:before {
border-left: 6px solid #000;
border-right: 6px solid #000;
border-top: 6px solid #000;
bottom: -6px;
content: "";
height: 0;
left: 50%;
margin-left: -6px;
position: absolute;
width: 0;
}
</style>

Hope this helps !

Powered by DW Question & Answer Pro