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

Ok much the same as a lot of themes on here, im using the simple method of using styles in the header of my WP theme to allow customizations, but the theme is currently in soft-reject citing this is not allowed

2 things, why is it allowed in other themes? and generally speaking what the best alternative? Iv used the old styles.php thing to mimic a css file but wasnt sure if thats still acceptable

Cheers folks

3072 posts
  • Has referred 50+ members
  • Has sold $40,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Had an item featured on Envato Market
+5 more
wickedpixel says

Inline css is another thing. The header area is reserved for dynamic css, generated by options & such. If you add there hardcoded one… is not cool.

159 posts
  • Has sold $100+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 10+ items on Envato Market
  • Has been part of the Envato Community for over 2 years
+1 more
s4nji says

Why would you want to hardcode some stylesheet code inline inside the header? Afaik, it gets loaded as page html content, slowing down the loading speed ( because the subsequent contents will be downloaded after the stylesheet code is downloaded ) and it cannot be cached.
If you want to make a configurable/dynamic stylesheet generated by options, you can try creating the stylesheet code template inside a file, which will then be parsed and outputted into a stylesheet file.

3544 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

Why would you want to hardcode some stylesheet code inline inside the header? Afaik, it gets loaded as page html content, slowing down the loading speed ( because the subsequent contents will be downloaded after the stylesheet code is downloaded ) and it cannot be cached.
If you want to make a configurable/dynamic stylesheet generated by options, you can try creating the stylesheet code template inside a file, which will then be parsed and outputted into a stylesheet file.

-1

Go with the code inside header.php (or wp_add_inline_style – much better) as it’s the best way in terms of easibility and speed. As Ovidiu said, the rejection reason might be for something else…

@s4nji you should never use WordPress to write files in a commercial theme. Otherwise you’ll have dozens of support tickets with permissions or host issues :)

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

you can try creating the stylesheet code template inside a file, which will then be parsed and outputted into a stylesheet file.

Yeah iv dont that before, which is what i meant when i said ‘styles.php thing to mimic a css file’ :)

The css in the header is just the dynamic stuff from the options panel which I thought was ok

1143 posts
  • Has referred 50+ members
  • Has sold $40,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 50+ items on Envato Market
+5 more
Smartik says

Use WP Filesystem or wp_add_inline_style(like Ruben already said).

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

Out of curiosity, is it now a no-no to simply enqueue a customstyle.css.php file?

3544 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

Out of curiosity, is it now a no-no to simply enqueue a customstyle.css.php file?

This is the most resource eating method you can use…

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

3544 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

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..

by
by
by
by
by
by