Home>Support>Less file is not being loaded via Less file filter

Less file is not being loaded via Less file filter

Notice: This thread is over two years old; the information may be outdated. Please consider creating a new thread if you require free support. If you have an active SiteOrigin Premium license, you can email our premium support desk at [email protected].

Hi all,

I tried to add a theme to Button widget using this short tutorial:

https://siteorigin.com/docs/widgets-bundle/getting-started/extending-existing-widgets/

Adding new theme to the Button themes dropdown works perfectly. Unfortunately adding .less file to style the new theme is not working at all. I’ve adjusted the function to match my theme’s folder structure, so it looks like this (I haven’t changed function’s name yet ):

function mytheme_button_less_file( $filename, $instance, $widget ){
    if( !empty($instance['theme']) && $instance['theme'] == 'test' ) {
        $filename = get_stylesheet_directory() . '/inc/siteorigin/button/button-one.less'; 
    }
    return $filename;
}
add_filter( 'siteorigin_widgets_less_file_sow-button', 'mytheme_button_less_file', 10, 3 );

and the .less file:

@font_size: 5em;

.ow-button-base {
	a {
		font-size: @font_size;
	}
}

Is there anything wrong with changes I made?

PS: All default themes work perfectly (XAMPP, Windows 10).

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More