<?xml version="1.0" encoding="UTF-8"?>
	<rss version="2.0"
		xmlns:content="http://purl.org/rss/1.0/modules/content/"
		xmlns:wfw="http://wellformedweb.org/CommentAPI/"
		xmlns:dc="http://purl.org/dc/elements/1.1/"
		xmlns:atom="http://www.w3.org/2005/Atom"

			>

	<channel>

		<title>Move inline CSS to external file &#8211; Themeco Community</title>
		<atom:link href="https://theme.co/archive/forums/topic/move-inline-css-to-external-file/feed/" rel="self" type="application/rss+xml" />
		<link>https://theme.co/archive/forums/topic/move-inline-css-to-external-file/feed/</link>
		<description></description>
		<lastBuildDate>Sat, 11 Oct 2025 09:16:38 +0000</lastBuildDate>
		<generator>https://bbpress.org/?v=2.6.14</generator>
		<language>en-US</language>

		
														
					
				<item>
					<guid>https://theme.co/archive/forums/topic/move-inline-css-to-external-file/#post-73503</guid>
					<title><![CDATA[Move inline CSS to external file]]></title>
					<link>https://theme.co/archive/forums/topic/move-inline-css-to-external-file/#post-73503</link>
					<pubDate>Fri, 25 Jul 2014 18:59:57 +0000</pubDate>
					<dc:creator>GDM-Pixel</dc:creator>

					<description>
						<![CDATA[
						<p>Dear support,</p>
<p>I&#8217;m trying to improve SEO on my website.</p>
<p>But I&#8217;m having a bit of trouble with something : </p>
<p>the customizer add a lot of inline CSS into the head. I think it&#8217;s from /x/framework/functions/global/admin/customizer/output.php</p>
<p>The file call the content of the &#8220;output&#8221; folder above it.</p>
<p>Is there a way to move all thoses CSS to an external file ? It will reduce the text to code ratio and will be much more efficient for SEO purpose. I tried earlier with a plugin called autoptimize, but it doesn&#8217;t work with W3 Total cache&#8230;</p>
<p>Is there a way to modify or override the function file so that output.php doesn&#8217;t load, and so that I can add the content of x-customizer-css-output to my regular stylesheet ?</p>
<p>my config : </p>
<p>Wordpress 3.9.1<br />
X theme 2.2<br />
shortcode 2.3.2<br />
Well, in fact, everything is up to date 🙂</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>https://theme.co/archive/forums/topic/move-inline-css-to-external-file/#post-73505</guid>
					<title><![CDATA[Reply To: Move inline CSS to external file]]></title>
					<link>https://theme.co/archive/forums/topic/move-inline-css-to-external-file/#post-73505</link>
					<pubDate>Fri, 25 Jul 2014 19:03:18 +0000</pubDate>
					<dc:creator>GDM-Pixel</dc:creator>

					<description>
						<![CDATA[
						<p>or maybe you could add a very cool improvment in a next version to output x-customizer-css-output to an external file ? 🙂</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>https://theme.co/archive/forums/topic/move-inline-css-to-external-file/#post-73856</guid>
					<title><![CDATA[Reply To: Move inline CSS to external file]]></title>
					<link>https://theme.co/archive/forums/topic/move-inline-css-to-external-file/#post-73856</link>
					<pubDate>Sat, 26 Jul 2014 23:34:19 +0000</pubDate>
					<dc:creator>Kosher K</dc:creator>

					<description>
						<![CDATA[
						<p>Hey Annoni, </p>
<p>You can use a <a href="http://theme.co/x/member/child-themes/" rel="nofollow">Child theme</a> and add the CSS directly in child theme style.css instead of customizer CSS.</p>
<p>You can follow this <a href="http://theme.co/x/member/kb/how-to-setup-child-themes/" rel="nofollow">guide</a> on how to set-up a child theme</p>
<p>Cheers </p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>https://theme.co/archive/forums/topic/move-inline-css-to-external-file/#post-74118</guid>
					<title><![CDATA[Reply To: Move inline CSS to external file]]></title>
					<link>https://theme.co/archive/forums/topic/move-inline-css-to-external-file/#post-74118</link>
					<pubDate>Sun, 27 Jul 2014 21:08:33 +0000</pubDate>
					<dc:creator>GDM-Pixel</dc:creator>

					<description>
						<![CDATA[
						<p>Hey Support,</p>
<p>I already have a child theme. I m referring here to the enormous amount of CSS code that is in the &lt;head&gt; section of a page, wich id is x-customizer-css-output</p>
<p>The code included on every page is the css entered in the database by the customizer.</p>
<p>Every time a user change some parameters in the customizer, the css code is updated, then downloaded by Php and output on pages.</p>
<p>But it&#8217;s quite big, and it&#8217;s very bad for text to code ratio.</p>
<p>So, as I found other people with the same issue, I checked at it.</p>
<p>If some other people on the forum wants to get rid of that enormous chunk of CSS in their head, please read the following (but please be aware that any modification done in the customizer won&#8217;t work anymore : you&#8217;ll have to uncomment the last line of /x/framework/functions/global/admin/customizer/output.php to see the css changes, copy it and paste it again in your child theme css). I guess this is for advanced users&#8230;</p>
<p>Here&#8217;s the trick :</p>
<ul>
<li>The code is generated by /x/framework/functions/global/admin/customizer/output.php, so find it using your ftp client</li>
<li>Copy the content of this function to your function.php in your Child theme folder.</li>
<li>Display source code of your page on your prefered browser</li>
<li>Copy the css content of x-customizer-css-output (it&#8217;s in the head section of your html code) and paste it in your child theme css</li>
</ul>
<p>Comment the last line of your functions.php file like this : <code>//add_action( &#039;wp_head&#039;, &#039;x_customizer_options_output_css&#039;, 9998, 0 );</code></p>
<p>This will prevent Php to add the big css output in your head.</p>
<p>Did it&#8217;s magic : no more &#8220;x-customizer-css-output&#8221; on my page. But I repeat : you won&#8217;t be able to use the customizer like before. It&#8217;s a tips for people who wants to improve their SEO on a site that is fully designed.</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>https://theme.co/archive/forums/topic/move-inline-css-to-external-file/#post-74129</guid>
					<title><![CDATA[Reply To: Move inline CSS to external file]]></title>
					<link>https://theme.co/archive/forums/topic/move-inline-css-to-external-file/#post-74129</link>
					<pubDate>Sun, 27 Jul 2014 22:14:31 +0000</pubDate>
					<dc:creator>Andrea G</dc:creator>

					<description>
						<![CDATA[
						<p>txs, great tip</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>https://theme.co/archive/forums/topic/move-inline-css-to-external-file/#post-74621</guid>
					<title><![CDATA[Reply To: Move inline CSS to external file]]></title>
					<link>https://theme.co/archive/forums/topic/move-inline-css-to-external-file/#post-74621</link>
					<pubDate>Tue, 29 Jul 2014 01:31:20 +0000</pubDate>
					<dc:creator>Christian</dc:creator>

					<description>
						<![CDATA[
						<p>Thanks for sharing Annoni. We are improving performance of X overtime. For now, we are trying to balance everything. Please stay tuned for future updates.</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>https://theme.co/archive/forums/topic/move-inline-css-to-external-file/#post-77024</guid>
					<title><![CDATA[Reply To: Move inline CSS to external file]]></title>
					<link>https://theme.co/archive/forums/topic/move-inline-css-to-external-file/#post-77024</link>
					<pubDate>Sun, 03 Aug 2014 06:48:06 +0000</pubDate>
					<dc:creator>TygrScott</dc:creator>

					<description>
						<![CDATA[
						<p>This just makes the site load blank now. I really wish x-customizer-css-output was sent to an external file somehow. It&#8217;s a huge block of code.</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>https://theme.co/archive/forums/topic/move-inline-css-to-external-file/#post-77162</guid>
					<title><![CDATA[Reply To: Move inline CSS to external file]]></title>
					<link>https://theme.co/archive/forums/topic/move-inline-css-to-external-file/#post-77162</link>
					<pubDate>Sun, 03 Aug 2014 21:51:09 +0000</pubDate>
					<dc:creator>GDM-Pixel</dc:creator>

					<description>
						<![CDATA[
						<p>TygrScott, you may have a blank page cause there s a typo in your function.php file</p>
<p>If you haven&#8217;t edit this file yet, it should look like this : </p>
<pre><code>&lt;?php

// =============================================================================
// FUNCTIONS.PHP
// -----------------------------------------------------------------------------
// Overwrite or add your own custom functions to X in this file.
// =============================================================================

// =============================================================================
// FUNCTIONS/GLOBAL/ADMIN/CUSTOMIZER/OUTPUT.PHP
// -----------------------------------------------------------------------------
// Sets up custom output from the Customizer.
// =============================================================================

// =============================================================================
// TABLE OF CONTENTS
// -----------------------------------------------------------------------------
//   01. Customizer Options CSS Output
// =============================================================================

// Customizer Options CSS Output
// =============================================================================
 
function x_customizer_options_output_css() {

  $outp_path = get_template_directory() . &#039;/framework/functions/global/admin/customizer/output&#039;;

  require_once( $outp_path . &#039;/variables.php&#039; );

  ob_start();

  ?&gt;

  &lt;style id=&quot;x-customizer-css-output&quot; type=&quot;text/css&quot;&gt;

    &lt;?php

    require_once( $outp_path . &#039;/&#039; . $x_stack . &#039;.php&#039; );
    require_once( $outp_path . &#039;/base.php&#039; );
    require_once( $outp_path . &#039;/masthead.php&#039; );
    require_once( $outp_path . &#039;/buttons.php&#039; );
    require_once( $outp_path . &#039;/widgets.php&#039; );
    require_once( $outp_path . &#039;/gravity-forms.php&#039; );

    ?&gt;

  &lt;/style&gt;

  &lt;?php

  $css = ob_get_contents(); ob_end_clean();

  //
  // 1. Remove comments.
  // 2. Remove whitespace.
  // 3. Remove starting whitespace.
  //

  $output = preg_replace( &#039;#/\*.*?\*/#s&#039;, &#039;&#039;, $css );            // 1
  $output = preg_replace( &#039;/\s*([{}|:;,])\s+/&#039;, &#039;$1&#039;, $output ); // 2
  $output = preg_replace( &#039;/\s\s+(.*)/&#039;, &#039;$1&#039;, $output );        // 3

  echo $output;

}
 
//add_action( &#039;wp_head&#039;, &#039;x_customizer_options_output_css&#039;, 9998, 0 );
</code></pre>
<p>But first, try to just add &#8220;//&#8221; at the bottom line of /x/framework/functions/global/admin/customizer/output.php and refresh your page</p>
<p>You won&#8217;t see the big CSS output anymore and your layout will be upside down :p</p>
<p>Add the content of /x/framework/functions/global/admin/customizer/output.php in your theme child function.php file will tell Php to overcharge the original function by the new one. All I did is comment the last line, the one that add the output in the head&#8230;</p>
<p>And I copied the content of the CSS output directly in my child theme css&#8230;</p>
<p>That&#8217;s it, it works, and it&#8217;s not a lot of coding&#8230;</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>https://theme.co/archive/forums/topic/move-inline-css-to-external-file/#post-77272</guid>
					<title><![CDATA[Reply To: Move inline CSS to external file]]></title>
					<link>https://theme.co/archive/forums/topic/move-inline-css-to-external-file/#post-77272</link>
					<pubDate>Mon, 04 Aug 2014 03:43:30 +0000</pubDate>
					<dc:creator>Christian</dc:creator>

					<description>
						<![CDATA[
						<p>Thanks for sharing Annoni.</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>https://theme.co/archive/forums/topic/move-inline-css-to-external-file/#post-97290</guid>
					<title><![CDATA[Reply To: Move inline CSS to external file]]></title>
					<link>https://theme.co/archive/forums/topic/move-inline-css-to-external-file/#post-97290</link>
					<pubDate>Wed, 03 Sep 2014 03:31:37 +0000</pubDate>
					<dc:creator>Lisa S</dc:creator>

					<description>
						<![CDATA[
						<p>Help! </p>
<p>When I do this, I get a PHP Fatal error: Cannot redeclare x_customizer_generated_css_output() previously declared in /home/&#8230;/wp-content/themes/x-child-ethos/functions.php:11) in /home/&#8230;/wp-content/themes/x/framework/functions/global/admin/customizer/output.php on line 56.</p>
<p>Any ideas? </p>
<p>I thought you could override a core function in the child theme&#8217;s functions.php. I realize I could delete the function in the X theme core, but when I upgrade X it&#8217;s going to come back to bite me again, and again&#8230;</p>
						]]>
					</description>

					
					
				</item>

					
		
	</channel>
	</rss>

