SimpleSites4U said
Ah I see – thanks for the clarification
Im not gonna lie, and please nobody take this as me moaning, but I still dont understand, iv just checked some WP themes on the front page, and in the header there is some styling, so im not sure why its not ok for me to follow suit

Sorry, i should have explained further – the reviewer supplied a screen shot of the code, which is the bit in the header im reffering to – I think the screenshot was supplied as this is the my first resubmission of the theme based on the original soft reject message which also stated about the inline styles

Again, sorry for not being totally clear buddy – and please no one think im whining, im a happy chappy, just curious

One of the reasons our theme was soft-rejected was because we had to “remove inline styles” and there was a screenshot of the dynamic options css in our header.php file. So the review at least seem to think it is.

We were the same as SimpleSites – seeing loads of themes putting options styles in header.php so we couldn’t understand why we were doing anything wrong there.

Can you clarify. If i want to dynamically change the color of some element, I would use like this:

<?php
$color="#000#;
?>
<div class="blah" style="background:<?php echo $color; ?>">
So is it allowed or not, if it is not then what should be alternative?
This is wrong inline styling.. You need to include your styles with <a href="http://codex.wordpress.org/Function_Reference/wp_add_inline_style">wp_add_inline_style</a> in the header, then use classes to style your elements..</div>

I believe they reject(soft) themes that hardcode it rather than using wp_inline_style, I know theres a ton of themes that do inline styles(in the dom) because of some of the visual editors use it. I think theres a semi confusion on internal css and inline css (even wp named the function wrong)

The best way to do this is to generate a CSS file once user change and save settings and then just include it as any other CSS file. Yes, there may be some questions time to time why nothing changed (because of not enough permissions to write the file), but its still the best way because its most efficient. You can create a FAQ in support tab and always direct people with problems to this page.

chrisakelley said
I believe they reject(soft) themes that hardcode it rather than using wp_inline_style, I know theres a ton of themes that do inline styles(in the dom) because of some of the visual editors use it. I think theres a semi confusion on internal css and inline css (even wp named the function wrong)

chrisakelley said
I believe they reject(soft) themes that hardcode it rather than using wp_inline_style, I know theres a ton of themes that do inline styles(in the dom) because of some of the visual editors use it. I think theres a semi confusion on internal css and inline css (even wp named the function wrong)

that thread was created two years before wp_inline_style was in the core, which does add styles to the head.

My comment was based of confusion of naming, wp_inline_style should be called wp_internal_style because thats what it does add CSS to the head(internal styling) not directly in the element(inline styling)

wp_enqueue loads an external stylesheet, which in that case they are showing it load a dynamic stylesheet(php rather than CSS) which is extremely slow and “can” cause security issues

chrisakelley said
that thread was created two years before wp_inline_style was in the core, which does add styles to the head.

Thanks. Could you please check my post above, in which I mentioned how I am adding the code directly to the div style. Is that bad approach? Could you please give an example on how to achieve that using the wp_inline_style method?
I’m trying the (only) example on that function documentation page, but it does not add anything in the custom.css file.

Post Reply

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody