426 posts
  • Sold between 10 000 and 50 000 dollars
  • Exclusive Author
  • Has been a member for 3-4 years
  • Bought between 50 and 99 items
  • Referred between 1 and 9 users
  • United Kingdom
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 been a member for 6-7 years
  • Won a Competition
  • Sold between 50 000 and 100 000 dollars
  • Bought between 10 and 49 items
  • Referred between 50 and 99 users
  • Exclusive Author
  • Romania
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
  • Envato Studio (Microlancer) Beta Tester
  • Has been a member for 2-3 years
  • Exclusive Author
  • Sold between 100 and 1 000 dollars
  • Bought between 10 and 49 items
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.

3445 posts Ruben Bristian
  • Most Wanted Bounty Winner
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Has been a member for 6-7 years
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Won a Competition
  • Bought between 100 and 499 items
  • Exclusive Author
  • Referred between 500 and 999 users
+5 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
  • Sold between 10 000 and 50 000 dollars
  • Exclusive Author
  • Has been a member for 3-4 years
  • Bought between 50 and 99 items
  • Referred between 1 and 9 users
  • United Kingdom
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

1081 posts
  • Forum Superstar
  • Most Wanted Bounty Winner
  • Envato Studio (Microlancer) Beta Tester
  • Author had a Free File of the Month
  • Bought between 50 and 99 items
  • Referred between 50 and 99 users
  • Europe
  • Has been a member for 3-4 years
  • Exclusive Author
+1 more
Smartik says

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

426 posts
  • Sold between 10 000 and 50 000 dollars
  • Exclusive Author
  • Has been a member for 3-4 years
  • Bought between 50 and 99 items
  • Referred between 1 and 9 users
  • United Kingdom
SimpleSites4U says

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

3445 posts Ruben Bristian
  • Most Wanted Bounty Winner
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Has been a member for 6-7 years
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Won a Competition
  • Bought between 100 and 499 items
  • Exclusive Author
  • Referred between 500 and 999 users
+5 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
  • Sold between 10 000 and 50 000 dollars
  • Exclusive Author
  • Has been a member for 3-4 years
  • Bought between 50 and 99 items
  • Referred between 1 and 9 users
  • United Kingdom
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

3445 posts Ruben Bristian
  • Most Wanted Bounty Winner
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Has been a member for 6-7 years
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Won a Competition
  • Bought between 100 and 499 items
  • Exclusive Author
  • Referred between 500 and 999 users
+5 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