• I love the plugin so far but I have one big issue with it – it does not allow to add custom css class to rows, the only option is to enter number of columns. I have a design that has full width slider and boxed rows – if I add 2 rows both are full width. It would be really cool if you guys can add ‘CSS class’ field on row adding modal window.

    https://www.ads-software.com/plugins/siteorigin-panels/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi,

    I found some filters to add custom styling to rows and cells

    function my_panels_row_style( $styles ) {
    	$styles['my-style-panels'] = __( 'My Style Panels', 'mytheme' );
    	return $styles;
    }
    add_filter( 'siteorigin_panels_row_styles', 'my_panels_row_style' );
    
    function my_panels_row_classes( $grid_classes ) {
    	$grid_classes[] = 'my-panel-grid';
    	return $grid_classes;
    }
    add_filter( 'siteorigin_panels_row_classes', 'my_panels_row_classes' );
    
    function my_panels_cell_classes( $cell_classes ) {
    	$cell_classes[] = 'my-panel-grid-cell';
    	return $cell_classes;
    }
    add_filter( 'siteorigin_panels_row_cell_classes', 'my_panels_cell_classes' );

    add this in your functions.php and add as many classes as you need.

    To override the styles just use something like:
    .panel-grid.my-panel-grid {margin: 0;}
    on your css files.

    That’s a neat solution, but you’re assuming a custom or child theme with a unique functions.php file is already in place or the custom code above will be over written with a theme update.

    It would be better if this was added in the vendors plug in code directly

    If you write it in the plugin code you would also have it overwritten when you update the plugin.

    The best option is to work with a child-theme. Even if is a commercial theme, is quite easy to add a child-theme to avoid your custom code being overwritten:

    https://codex.www.ads-software.com/Child_Themes

    And also some of the commercial themes may come already with the option to add a child-theme.

    Yes I am aware of that, and I have the means to make a child theme, I just don’t want to – time and client issues. Like I say it would better if the plug in vendor added some sensible row classes or IDs directly to the plugins files then it would not be affected by any updates. Perhaps they can take your good sample code and add it directly to the plug in for us.

    Thread Starter pciesielski

    (@pciesielski)

    Hey guys,
    Regarding my first post this is what I would like to have:
    https://i.imgur.com/iDlYUXp.jpg.
    When you click the ‘add row’ button (1) you have only one input to enter number of columns, I would like to add there (2) a new input to enter a class name. The modal window is hardcoded so it’s impossible to add custom fields there.

    I also added the feature request to their official forum two weeks ago – https://siteorigin.com/thread/custom-css-classes-for-rows/ because they probably do not read this support forum.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘CSS Class for rows’ is closed to new replies.