Before and After Rows filter
Hello,
I am trying to use the siteorigin_panels_before_row and the siteorigin_panels_after_row filters in my theme, and I am really confused by the documentation, and I can’t get the behavior I want. In fact, I get no behavior at all, which leads me to believe that I’m not using them properly.
Here’s what I am looking for:
I am trying to wrap every row’s content on every page/post in a standard container div. Why? I want the row itself to the be full with of the viewport, but I want the content (i.e. all of the panel-grid-cells) to be constrained to my site’s standard container parameters (width, margin, padding, etc). I need the row to be the full of with of the viewport so I can style it according to my users’ specifications. Here’s the desired output HTML for reference:
<div id="..." class="panel-grid">
<div class="container">
<div id="..." class="panel-grid-cell"></div>
...
...
</div>
</div>If anybody could help me with doing that, or point me in the direction of a filer that might better meet my need (and explain it) it would be very much appreciated.
Side question: I’m noticing this ‘premium version’ stuff at the bottom of the page. I work for a large enterprise, and we would be interested in a a paid support contract of some kind. Please let me know where I could find information on this.
Thanks much,
—Dan
This is our free support forum. Replies can take several days.
Need fast email support? Get SiteOrigin Premium
Replies
2function before_row(){ return '<div class="class">'; } add_filter('siteorigin_panels_before_row', 'before_row', $panels_data['grids'][$gi], $grid_attributes); function after_row(){ return '</div>'; } add_filter('siteorigin_panels_after_row', 'after_row', $panels_data['grids'][$gi], $grid_attributes);Oop! Last one wasn’t so good.
I’m trying to do exactly the same thing.
This worked:
function before_row($panels_data, $grid_attributes){ $returnString = '<div class="' . $grid_attributes[style]['class'] . '">'; return $returnString; } add_filter('siteorigin_panels_before_row', 'before_row', 10, 2); function after_row(){ return '</div>'; } add_filter('siteorigin_panels_after_row', 'after_row', 10, 2);in the row options the user adds a class that indicated the background color of the full width section. The filter above applies that class to the extra div.
Hope this helps!
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.