April 1, 2010
All I want to do is put an image on the bottom-right of my page, in the sidebar. Within WordPress, if I add the Text widget to my sidebar, it takes on the Artisteer theme’s style. This is by design. But, I don’t want any style at all. I just want the image to appear, centered.
How can I strip out the CSS style from a particular widget, then?
if (function_exists(‘register_sidebars’)) {
register_sidebars(3, array(
‘before_widget’ => ‘<div id=”%1$s” >’.'<!— BEGIN Widget —>’,
‘before_title’ => ‘<!— BEGIN WidgetTitle —>’,
‘after_title’ => ‘<!— END WidgetTitle —>’,
‘after_widget’ => ‘<!— END Widget —>’.'</div>’
));
}
<div id=”%1$s”> This code will give the widget’s containing DIV element an id value for use in the theme’s CSS. The value, here, is generated by WordPress and corresponds to the widget being used.
div#execphp-6 {
text-align: center;
}
div#execphp-6 .art-Block-cc {
background-color: #ababab;
bottom: 0px;
top: 0px;
right: 0px;
left: 0px;
padding: 0px;
}
It took me way too long to figure this out, but it works well and I am very happy!! Now I can add style-free or custom-styled widgets wherever I want.
Follow