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.

Disable inline styling of the layout

9 years ago · Last reply by Alex S 9 years ago

Is it possible to disable the inline styling when doing layout?
I just created 3 blank rows and it adds these styles to my page:

<style type="text/css" media="all" id="siteorigin-panels-grids-wp_head">/* Layout 23 */ #pg-23-0 , #pl-23 .panel-grid-cell .so-panel { margin-bottom:30px } #pg-23-0 .panel-grid-cell { float:none } #pgc-23-1-0 , #pgc-23-1-1 { width:50% } #pg-23-1 .panel-grid-cell { float:left } #pl-23 .panel-grid-cell .so-panel:last-child { margin-bottom:0px } #pg-23-0 , #pg-23-1 { margin-left:-15px;margin-right:-15px } #pg-23-0 .panel-grid-cell , #pg-23-1 .panel-grid-cell { padding-left:15px;padding-right:15px } @media (max-width:780px){ #pg-23-0 .panel-grid-cell , #pg-23-1 .panel-grid-cell { float:none;width:auto } #pgc-23-1-0 { margin-bottom:30px } #pl-23 .panel-grid , #pl-23 .panel-grid-cell {  } #pl-23 .panel-grid .panel-grid-cell-empty { display:none } #pl-23 .panel-grid .panel-grid-cell-mobile-last { margin-bottom:0px }  } </style>

thanks

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

Need fast email support? Get SiteOrigin Premium

Replies

6
  1. design4life 9 years, 2 months ago

    should this be loaded using a css file?

  2. Alex S Staff 9 years, 2 months ago

    Hi Design4life,

    Sorry about missing this. It seems we missed a number of threads on the day you posted this one and the other thread. :(

    To prevent these inline styles you’ll need to remove the hook using PHP. Please note that if you remove these you’ll need to manually handle the layout CSS as this CSS is only added via inline styles at this time.

    The PHP for this will look something like this:

    function siteorigin_panels_remove_inline_css(){
    	remove_action( 'wp_head', 'siteorigin_panels_print_inline_css', 12 );
    	remove_action( 'wp_footer', 'siteorigin_panels_print_inline_css' );
    }
    add_action( 'init', 'siteorigin_panels_remove_inline_css' );
    

    You’ll need to add this to either a child theme or a plugin like Code Snippets.

  3. design4life 9 years, 1 month ago

    @Alex if we remove the style as suggested in your answer, where can I find the style to manually include in my theme?

  4. Alex S Staff 9 years, 1 month ago

    Hi Design4life,

    I mean, you can’t… well, not easily anyway. All of the styles added via siteorigin_panels_print_inline_css are done on the fly and not pre-generated. This means it’s not us just outputting CSS instead of including it externally, it’s being done inline due to it being the easiest way to store CSS like this without running into cache issues. It should also be noted that this CSS is generated on a post by post basis (it’ll only output CSS relevant to the current page) so it’s not a single set of CSS.

    I can’t assist with doing this but your best bet at doing this would be to run siteorigin_panels_print_inline_css and remove the HTML from the resulting data () and then store it on a post by post and page by page manner. This is obviously something I would not recommend.

    • design4life 9 years, 1 month ago

      In that case why not generate a css file dynamically?
      like this: https://css-tricks.com/css-variables-with-php/
      I think to output a bunch of inline style is not a good idea.

      • Alex S Staff 9 years, 1 month ago

        Hi Design4life,

        Long story short, fewer issues arise via inline styles. A request on a very well optimized site may take less than one tenth of second but on a poorly optimized site (typically without any) it could take seconds. There’s also the issues that occur due to caching, which we need to avoid at all costs.

        The most I can do sadly is provide basic instructions on how to do this (see above), I can not assist with doing this. I will also state we won’t be offering such an option anytime soon. We used to have it and the performance issues and general issues it caused made this the right choice for not only us but our users. Sorry.

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.

Have a different question or issue?

Start New Thread