Quantcast
Channel: WordPress.org Forums » [Autoptimize] Support
Viewing all articles
Browse latest Browse all 14094

masoyag on "[Plugin: Autoptimize] Print css gets into seprate css file"

$
0
0

Hi,
first of all Autoptimize is awesome - thank you for your work.

I have issue with Vantage theme.

In functions.php there is this code:

add_action( 'widgets_init', 'vantage_widgets_init' );

function vantage_print_styles(){
	if( !siteorigin_setting('layout_responsive') ) return;

	// Create the footer widget CSS
	$sidebars_widgets = wp_get_sidebars_widgets();
	$count = isset($sidebars_widgets['sidebar-footer']) ? count($sidebars_widgets['sidebar-footer']) : 1;
	$count = max($count,1);

	?>
	<style type="text/css" media="screen">
		#footer-widgets .widget { width: <?php echo round(100/$count,3) . '%' ?>; }
		@media screen and (max-width: 640px) {
			#footer-widgets .widget { width: auto; float: none; }
		}
	</style>

When Autoptimize is disabled it just prints it in page as:
#footer-widgets .widget{width:100%}@media screen and (max-width:640px){#footer-widgets .widget{width:auto;float:none}}
But when plugin is enabled it creates a separate css file with just this code.

How I can leave it as print css?

Many thanks

https://wordpress.org/plugins/autoptimize/


Viewing all articles
Browse latest Browse all 14094

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>