Viewing 9 replies - 1 through 9 (of 9 total)
  • This should be built in so you can also assign classes to the panels you create.

    Agreed with gruvii

    I have the same widgets/rows on multiple pages and if there was a class you could apply the styles to the same classes for all of them. Also, if you switch the order of rows right now, the ID changes so the css for the rows don’t work anymore.

    Yes, that feature would be extremely helpful.

    Agreed.
    An option to add classnames to rows, columns and widgets would really take Page Builder to the next level.

    +5 from me!

    Hey guys,

    The Widget CSS Classes plugin doesn’t work with Page Builder (and I couldn’t figure out how to easily get it to work), so I’ve worked around it for my uses. This may help you, depending on what you’re doing.

    Firstly, I added this line:

    $classes=apply_filters(“siteorigin_panels_custom_widget_class”,$classes,$the_widget,$instance);

    above the setting of $args in siteorigin_panels_the_widget() in siteorigin-panels.php (its around line 825).

    If the Site Origin team could include this filter, or similar, in a future version that would be fantastic!

    Then, from your theme’s functions.php, you can access this filter to add any classes that you need to the widget. You have the use of both the widget’s object AND its instance, so you could probably use these to do almost anything you wanted to. For example, I’m using the Better Menu plugin to allow classes to be added to a menu. All I’ve set up this function to do is add that same class to the widget if its in the menu. Of course, from this function you could print_r the variables you have received so you can check what you have to work with:

    function yourtheme_modify_classes($classes,$widget,$instance){
    if(isset($instance[“menu_class”])) $classes[]=$instance[“menu_class”];
    return $classes;
    }
    add_filter(“siteorigin_panels_custom_widget_class”,”yourtheme_modify_classes”,10,3);

    +10 Agreed. Also, a simple class of something like “panel-grid-cell 1-4” would be perfect so that I can target the styles specifically based on the amount of columns. The fact that Page Builder is adding the row number to the class is throwing me off :/

    – Daniel

    If you require assistance then, as per the Forum Welcome, please post your own topic instead of tagging onto someone else’s topic.

    I am now closing this 6 month old topic as it references an older version of WordPress.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Page Builder and Widget CSS Classes’ is closed to new replies.