426 posts
  • Has referred 1+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 50+ items on Envato Market
  • Sells items exclusively on Envato Market
+2 more
SimpleSites4U says


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
You don’t understand. Inline style is not header style! Maybe the reviewer spoke of something else than your header styles. Inline styles are style properties added directly to DOM elements..

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 :)

22 posts
  • Has been part of the Envato Community for over 1 year
  • Has sold $1,000+ on Envato Market
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
WiredThemes says

You don’t understand. Inline style is not header style! Maybe the reviewer spoke of something else than your header styles. Inline styles are style properties added directly to DOM elements..

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.

3711 posts Ruben Bristian
  • Sells items exclusively on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $500,000+ on Envato Market
  • Has been part of the Envato Community for over 6 years
+10 more
KrownThemes says

Have you added the code via wp_inline_style or simply hard coded it?

148 posts
  • Has been part of the Envato Community for over 1 year
loveetc says

Have you added the code via wp_inline_style or simply hard coded it?

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?</div>
3711 posts Ruben Bristian
  • Sells items exclusively on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $500,000+ on Envato Market
  • Has been part of the Envato Community for over 6 years
+10 more
KrownThemes says


Have you added the code via wp_inline_style or simply hard coded it?

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>
3436 posts
  • Has sold $5,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Located in United States
  • Has been part of the Envato Community for over 4 years
+1 more
organicbee says

Have you added the code via wp_inline_style or simply hard coded it?

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)

141 posts moutheme
  • Had an item featured in an Envato Bundle
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $125,000+ on Envato Market
  • Made it to the Authors' Hall of Fame
+7 more
moutheme says

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.

148 posts
  • Has been part of the Envato Community for over 1 year
loveetc says

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)
This answer suggests its much slower to add css via wp_enqueue_style, it recommends adding the style block in the header: http://wordpress.stackexchange.com/a/1480
3436 posts
  • Has sold $5,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Located in United States
  • Has been part of the Envato Community for over 4 years
+1 more
organicbee says


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)
This answer suggests its much slower to add css via wp_enqueue_style, it recommends adding the style block in the header: http://wordpress.stackexchange.com/a/1480

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

148 posts
  • Has been part of the Envato Community for over 1 year
loveetc says

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.

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<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

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by