<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<title></title>
</head>
<body text="#000000" bgcolor="#ffffff">
We can all thank Otto for this:<br>
<a class="moz-txt-link-freetext" href="http://ottopress.com/2011/tutorial-using-the-wp_filesystem">http://ottopress.com/2011/tutorial-using-the-wp_filesystem</a><br>
<br>
Great writeup! Go ahead and bookmark it so we'll have a reference
each time this same discussion crops up.<br>
<br>
On 4/4/2011 10:17 PM, Emil Uzelac wrote:
<blockquote
cite="mid:BANLkTi=WdC8AjQh8LUtQxZp2v80QPaEpew@mail.gmail.com"
type="cite">
<div><font size="2"><font face="tahoma,sans-serif">This is
definitely the most comprehensive WordPress related e-mail
that I have ever seen.</font></font></div>
<div> </div>
<div><font size="2"><font face="tahoma,sans-serif">Thanks Otto.</font></font></div>
<div> </div>
<div><font size="2"><font face="tahoma,sans-serif">Emil</font></font></div>
<font size="2"><font face="tahoma,sans-serif">
<div><br clear="all">
</div>
</font></font>
<div><strong>Emil Uzelac</strong> | ThemeID | T: 224-444-0006 |
Twitter: @EmilUzelac | E: <a moz-do-not-send="true"
href="mailto:emil@themeid.com" target="_blank">emil@themeid.com</a>
| <a moz-do-not-send="true" href="http://themeid.com/"
target="_blank">http://themeid.com</a></div>
<div><font color="#999999">Make everything as simple as possible,
but not simpler. - Albert Einstein</font></div>
<br>
<br>
<br>
<div class="gmail_quote">On Mon, Apr 4, 2011 at 9:51 PM, Otto <span
dir="ltr"><<a moz-do-not-send="true"
href="mailto:otto@ottodestruct.com">otto@ottodestruct.com</a>></span>
wrote:<br>
<blockquote style="margin: 0px 0px 0px 0.8ex; padding-left: 1ex;
border-left: 1px solid rgb(204, 204, 204);"
class="gmail_quote">
<div class="im">On Mon, Apr 4, 2011 at 8:15 PM, Lmm Muc <<a
moz-do-not-send="true" href="mailto:lmmmuc@gmail.com">lmmmuc@gmail.com</a>>
wrote:<br>
</div>
<div class="im">> I plan to write dynamic CSS to a file
(ending on .css) located in the theme<br>
> folder<br>
<br>
</div>
With regards to this specific problem, there is a couple of
issues<br>
with the idea:<br>
<br>
1. On any kind of secure setup, you probably don't have
permissions to<br>
write files into the themes directory. Using the upload folder
would<br>
work, but suffers the same ownership problems. Using the
WP_Filesystem<br>
to write the file works around this ownership and permissions
problem,<br>
but if you write into the themes directory, a theme upgrade
wipes out<br>
your static file.<br>
<br>
2. For any normal kind of theme, you probably don't have that
much<br>
dynamic CSS that you actually need to create. You probably
only have a<br>
few settings, for things like colors, fonts, etc. No more than
1K of<br>
code, probably. The dynamic CSS should go *inline* in the page
itself.<br>
Minified, if you prefer.<br>
<br>
Look at how the custom_background and custom_header stuff in
core<br>
works. It's creating CSS and then inserting it right into the
page<br>
using the wp_head hook. That's the right way to do dynamic
CSS. Not<br>
only does it avoid the whole writing files problem, but it
also avoids<br>
an extra HTTP round trip to the server to get your
dynamically-written<br>
static, but small, CSS file. It's actually faster and simpler
to put<br>
the dynamic CSS inline on the page itself.<br>
<font color="#888888"><br>
-Otto<br>
</font>
<div>
<div class="h5">_______________________________________________<br>
theme-reviewers mailing list<br>
<a moz-do-not-send="true"
href="mailto:theme-reviewers@lists.wordpress.org">theme-reviewers@lists.wordpress.org</a><br>
<a moz-do-not-send="true"
href="http://lists.wordpress.org/mailman/listinfo/theme-reviewers"
target="_blank">http://lists.wordpress.org/mailman/listinfo/theme-reviewers</a><br>
</div>
</div>
</blockquote>
</div>
<br>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
theme-reviewers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:theme-reviewers@lists.wordpress.org">theme-reviewers@lists.wordpress.org</a>
<a class="moz-txt-link-freetext" href="http://lists.wordpress.org/mailman/listinfo/theme-reviewers">http://lists.wordpress.org/mailman/listinfo/theme-reviewers</a>
</pre>
</blockquote>
</body>
</html>