This thread is over two years old and may be outdated. Please create a new thread if you need help, or email us if you have an active Premium license.

Custom option and before row content

10 years ago

Hi, I want to div, who is goes before row(“siteorigin_panels_before_row”) take color from custom option. It works on same way but it late one field… I tried with some other approaches but I had no luck…

Img:
http://postimg.org/image/idrqjd7jt/

First div(this div is not seen on image) is white but it must be red .
Second div is red but must be orange (plugin div is orange but my custom div is not).
Third div is orange but must be green (plugin div again have right color but mine div not).
etc..

Code:

function custom_row_style_attributes( $attributes, $args ) {
    global $color;
    if( !empty( $args['test1'] ) ) {
        $color = $args['test1'];
        $attributes['style'] = [];
        array_push($attributes['style'], 'background:'. $color);
    }
    return $attributes;
}
add_filter('siteorigin_panels_row_style_attributes', 'custom_row_style_attributes', 10, 2);
function before_row(){
    global $color;
    $html = '';
    $html .= '<div class="container">';
    return $html;
}
function after_row(){
    $html = '</div>';
    $html .= '';
    return $html;
}
add_filter( 'siteorigin_panels_before_row', 'before_row');
add_filter( 'siteorigin_panels_after_row', 'after_row');

I would appreciate it if you could help me.

This is our free support forum. Replies can take several days.

Need fast email support? Get SiteOrigin Premium

Have a different question or issue?

Start New Thread