Home>Support>How to filter Less on child theme

How to filter Less on child theme

Hi,

I’m trying to change the default color for buttons in the button widget. I’m running vantage with a child theme, and thought I could do something like this in the child theme’s `functions.php`:

function ms_filter_sow_button_less( $less, $instance, $widget ) {
        $less = str_replace('button_color: #41a9d5;',
            'button_color: #cecece;', $less);

        return $less;
}
add_filter('siteorigin_widgets_less_sow-button', 'ms_filter_sow_button_less',
    10, 3);

But … nothing happens. Am I misunderstanding something?

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

  1. 1 year, 3 months ago Alex S Hi, I Work Here

    Hi Cwrichardson,

    I recommend changing the default color of the button color setting itself. This can be done by using siteorigin_widgets_form_options_sow-button. The button color can be accessed via $form_options[‘design’][‘button_color’]

    You could also override LESS variables directly by using siteorigin_widgets_less_variables_WIDGET_SLUG.

    Kind regards,
    Alex

Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More