Hi @xycris
Thanks for reaching out.
Is there a particular reason you’re looking to remove wp_head ? It’s arguably one of the most essential theme hooks.
Thread Starter
xycris
(@xycris)
Hi misplon, Thank you very much for the immediate response.
I understand. We are also in need of that hook for templates we made, however, this specific template of our client calls for codes that are not hosted in our client’s server that we have a hard time to over ride. It is a very old template and our client wants to keep it. I am not sure when was the table the “in thing” for building themes.
We are creating simplified pages that totally ignores the wp_head() hook and just contain the body without any navigation or footer much like a dead end page. These pages are actually just secret pages accessible to members only. I can’t show you a sample because of its nature.
Is that possible?
Thanks for explaining. That makes sense.
On line 1029 of siteorigin-panels.php you’ll find the function in question. I guess you could remove the action on line 1049 (remove_action) and then add your own action to replace.
Page Builder previously had the option to add CSS as a file instead of inline. This caused significant performance issues so it was dropped. I think that option was available pre 2.0. If you’re working in a safe development environment you could perhaps try out 1.4.12 and see if the option is in that version:
https://wordpress.org/plugins/siteorigin-panels/developers/
Thread Starter
xycris
(@xycris)
Hi Misplon,
Thank you very much for you response.
I am confused now.
I tried the following code but gives me only the meta keyword ‘yes’:
<?php if ( function_exists('siteorigin_panels_print_inline_css')) : ?>
<meta name="keywords" content="yes">
<?php
add_action('xycris','siteorigin_panels_print_inline_css');
echo do_action('xycris');
?>
<?php else : ?>
<meta name="keywords" content="no">
<?php endif; ?>
Am I doing it right?
I wish the following code could appear:
<style type="text/css" media="all" id="siteorigin-panels-grids-wp_head">/* Layout 1386 */ #pl-1386 .panel-grid-cell .so-panel { margin-bottom:30px } #pl-1386 .panel-grid-cell .so-panel:last-child { margin-bottom:0 } @media (max-width:780px){ #pg-1386-0 .panel-grid-cell { float:none;width:auto } #pl-1386 .panel-grid { margin-left:0;margin-right:0 } #pl-1386 .panel-grid-cell { padding:0 } } </style>
I’ll ask @gpriday if he can check this for us later but the following is working in my Vantage Child theme, although it’s a normal child theme with a wp_head hook:
remove_action( 'wp_head', 'siteorigin_panels_print_inline_css', 12 );
add_action( 'vantage_main_top', 'siteorigin_panels_print_inline_css', 12 );
vantage_main_top is an existing theme hook in the theme I’m working with. That’s the only value that needs changing above.
Hope it helps.
@gpriday took a look now. The above should do the trick π
Thread Starter
xycris
(@xycris)
Hi Misplon,
Thank you very much for staying with me on this.
I will check the code out and see how it works with this task of mine.
I will let you know the result.
For sure π Let us know how you come along.
Thread Starter
xycris
(@xycris)
Hi Misplon,
Just to let you know, things worked best for our client.
Thank you very much!
Super, really glad to hear it π
All the best.