Home>Support>Panels Rendering Hooks

Panels Rendering Hooks

Hey guys, I spent 16 hours yesterday integrating Vantage to work with WooCommerce in the way I thought it should already work. (i.e. custom CSS to allow Page Builder to work with product descriptions). Now I have moved on to making Page Builder work with the Shop page. I am *extremely* close to making this work, however – I can’t figure out which hook to use just to initiate the loading of the correct css script.
I have built the two content wrapping functions, but it will not load panels*.css
echo siteorigin_panels_render(‘5’) is the closest I’ve gotten to it pulling the right css form into the page. This however does not do what I need it to do.
How do I initiate the hook that calls for the reference css to be loaded? I can give a lot more detail, I just didn’t want to dig everything out of my notes if this was something you guys could answer straight away.
Thanks,
David Rice

URL: http://www.inetdirectsales.com

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

  1. 9 years, 6 months ago Daniel
    Hi, I Work Here

    Hi David,

    You can place any custom CSS directly to the Custom CSS section. If you navigate to Appearance > Custom CSS, you’ll get our custom CSS editor. Just add the codes there and it will be applied in your site.

    Try that out and let me know when you encounter any difficulties while implementing this

    Cheers

  2. 9 years, 6 months ago David Ray Rice

    Yes, I have the custom CSS figured out, but instead of copying the code into Custom CSS for one page, I would rather have it automatically pulled in by hooking the content wrapper.

    The problem is calling the script so it renders most of the CSS for me –
    back tracking through all of the code is painstakingly long. Basically – I want to initialize the panels plugin for a certain page that doesn't call it automatically.

    Or a better explanation would be:

    What are the exact hooks for the content wrapper to initialize siteorigin-panels . I would like to wrap meta coming from the database in the panels plugin, so it overrides what is currently happening.

    The page I am dealing with seems to override pulling the template correctly. I want to manually initialize it.

    I have achieved it with unwanted results by doing the echo siteorigin_panels_render('5').

    This will automatically pull the content out for page 5 and wrap it in the panels css correctly.

    If I don't echo siteorigin_panels_render('5') – then it will not pull the following into the page:
    <link rel='stylesheet' id='siteorigin-panels-front-css' href='
    http://www.dricetech.com/wp-content/plugins/siteorigin-panels/css/front.css?ver=2.0.7&#039;
    type='text/css' media='all' />

    Any information you can tell me on how the following works would be great as well:

    .panel:first-child {

    .panel:last-child {

    Something keeps hiding certain divs.

    It's part of the content wrapping but sometimes causes undesired effects.

    Sometimes only the first-child will be visible when adding more than 2 panels, sometimes only 2 panels in a row will show up when they are put together. If you add a 3rd panel in Page Builder then only the first widget will appear.

  3. 9 years, 6 months ago Braam Genis
    Hi, I Work Here

    Hi David

    If you want to change the Page Builder metadata, you can use the ‘siteorigin_panels_data’ filter:

    function my_panels_data_filter( $panels_data, $post_id ) {
    	//do some stuff to $panels_data here.
    	return $panels_data;
    }
    add_filter( 'siteorigin_panels_data', 'my_panels_data_filter' );
    

    Or, if you want to change the Page Builder CSS, you can use the ‘siteorigin_panels_css_object’ filter:

    function my_panels_css_filter( $css, $panels_data, $post_id ) {
    	//do some stuff to $css here.`
    	return $css;
    }
    add_filter( 'siteorigin_panels_css_object', 'my_panels_css_filter' );
    

    Hope that helps!

  4. 9 years, 6 months ago David Ray Rice

    This is helpful but still not what I need. I need to call the CSS script into pages that don't support my theme.

    I can't find the proper command to enqueue the panels plugin css script so it's automatically included at the top of the page.

    Is there an easy way to do that?

  5. 9 years, 6 months ago Braam Genis
    Hi, I Work Here

    Hi David

    You can enqueue Page Builder styles in your child theme with the `wp_enqueue_scripts` hook using `wp_enqueue_style`, as follows:

    function enqueue_panels_styles() {
    	if( is_singular('product') ) {
    		wp_enqueue_style('siteorigin-panels-front');
    	}
    }
    add_action( 'wp_enqueue_scripts', 'enqueue_panels_styles' );
    

    Then the issue with divs being hidden is due to a bug which should be fixed in the 2.1 release of Page Builder.

    Hope that’s what you were looking for.

  6. 9 years, 6 months ago David Ray Rice

    Braam,

    You are definitely on top of this code. I haven't implemented this yet –
    but this is exactly what I've been looking for.

    Also – how did you know the divs were getting hidden? This is my exact issue.

    When is the expected release of Page Builder 2.1?

    I'd much rather not hack the code.

  7. 9 years, 6 months ago Braam Genis
    Hi, I Work Here

    Hi David.

    I’m really glad that helped you.

    You mentioned in your second post that you were having trouble with hidden divs. :)

    We’re trying to get it out as soon as possible, but unfortunately I can’t give you a date right now. We often announce new releases in our newsletter, if you’d like to keep track of what we’re up to. :)

    Cheers

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