WordPress widgets: how to change the automatically created "style" attribute of the surrounding HTML -


i have copied twentythirteen wordpress theme dive wordpress development. want change of footer, used firefox inspector play around it. widgets in footer sidebar have following html around them:

<aside style="position: absolute; left: 0px; top: 0px;" id="text-5" class="widget widget_text masonry-brick">     <div class="textwidget">         <p>my text content</p>     </div> </aside> 

i want rid of "position: absolute" css directive not find spot style attribute added widget's html code. widget definition in functions.php of used theme not include style attribute @ all:

function twentythirteen_widgets_init() {     register_sidebar( array(         'name'          => __( 'main widget area', 'twentythirteen' ),         'id'            => 'sidebar-1',         'description'   => __( 'appears in footer section of site.', 'twentythirteen' ),         'before_widget' => '<aside id="%1$s" class="widget %2$s">', // no style attribute...         'after_widget'  => '</aside>',         'before_title'  => '<h3 class="widget-title">',         'after_title'   => '</h3>',     ) ); // ... 

now wonder "magic" happens can stop it. disabled relevant plugins did not change anything. browsed theme's files didn't see anything, did miss it? thought might able change surrounding html on widget settings page in admin panel not find such option.

generally, can set bigger priority (!important) element stylesheet or overwrite inline style later inline style commands, such javascript runs after.

but, in case, inline style coming 'jquery-masonry' jquery plugin, changing inline style here not idea. if want remove it, need disable 'jquery-masonry'. can use wp_dequeue_script:

function wpdocs_dequeue_script() {    wp_dequeue_script( 'jquery-masonry' ); } add_action( 'wp_print_scripts', 'wpdocs_dequeue_script'); 

put in function.php file (since using 'twentythirteen' theme parent, need create child theme if didn't already) , after can use class / id of element change style style.css file.


Comments