Skip to main content
added 123 characters in body
Source Link
Wyck
  • 18k
  • 4
  • 46
  • 67

I would like to create a theme options page based only on changing the site wide CSS styling. For instance body/container background colors, font-sizes, font colors, etc.

I have accomplished this by using a stylesheet link to a php file in the header that echo's the CSS and uses get_option.

For instance background-color: <?php echo get_option('background_color'); ?>;

Would I be correct in assuming this is a bad idea performance wise if there are many options?

I have tried other methods but they all seem to add inline or embedded styles, which I do not want, how would one get around this?

Would creating a custom script that writes to the static CSS file be a good idea?

Is there any way the settings API can handle this?

** PS. Great answer but I have decided to actually go with writing to a static file as it provides way less overhead.

I would like to create a theme options page based only on changing the site wide CSS styling. For instance body/container background colors, font-sizes, font colors, etc.

I have accomplished this by using a stylesheet link to a php file in the header that echo's the CSS and uses get_option.

For instance background-color: <?php echo get_option('background_color'); ?>;

Would I be correct in assuming this is a bad idea performance wise if there are many options?

I have tried other methods but they all seem to add inline or embedded styles, which I do not want, how would one get around this?

Would creating a custom script that writes to the static CSS file be a good idea?

Is there any way the settings API can handle this?

I would like to create a theme options page based only on changing the site wide CSS styling. For instance body/container background colors, font-sizes, font colors, etc.

I have accomplished this by using a stylesheet link to a php file in the header that echo's the CSS and uses get_option.

For instance background-color: <?php echo get_option('background_color'); ?>;

Would I be correct in assuming this is a bad idea performance wise if there are many options?

I have tried other methods but they all seem to add inline or embedded styles, which I do not want, how would one get around this?

Would creating a custom script that writes to the static CSS file be a good idea?

Is there any way the settings API can handle this?

** PS. Great answer but I have decided to actually go with writing to a static file as it provides way less overhead.

added 86 characters in body
Source Link
Wyck
  • 18k
  • 4
  • 46
  • 67

I would like to create a theme options page based only on changing the site wide CSS styling. For instance body/container background colors, font-sizes, font colors, etc.

I have accomplished this by using a stylesheet link to a php file in the header that echo's the CSS and uses get_option.

For instance background-color: <?php echo get_option('background_color'); ?>;

Would I be correct in assuming this is a bad idea performance wise if there are many options?

I have tried other methods but they all seem to add inline or embedded styles, which I do not want, how would one get around this?

Would creating a custom script that writes to the static CSS file be a good idea?

Is there any way the settings API can handle this?

I would like to create a theme options page based only on changing the site wide CSS styling. For instance body/container background colors, font-sizes, font colors, etc.

I have accomplished this by using a stylesheet link to a php file in the header that echo's the CSS and uses get_option.

For instance background-color: <?php echo get_option('background_color'); ?>;

Would I be correct in assuming this is a bad idea performance wise if there are many options?

I have tried other methods but they all seem to add inline or embedded styles, which I do not want, how would one get around this?

Is there any way the settings API can handle this?

I would like to create a theme options page based only on changing the site wide CSS styling. For instance body/container background colors, font-sizes, font colors, etc.

I have accomplished this by using a stylesheet link to a php file in the header that echo's the CSS and uses get_option.

For instance background-color: <?php echo get_option('background_color'); ?>;

Would I be correct in assuming this is a bad idea performance wise if there are many options?

I have tried other methods but they all seem to add inline or embedded styles, which I do not want, how would one get around this?

Would creating a custom script that writes to the static CSS file be a good idea?

Is there any way the settings API can handle this?

Source Link
Wyck
  • 18k
  • 4
  • 46
  • 67

Best practices for a Style/CSS based theme options page?

I would like to create a theme options page based only on changing the site wide CSS styling. For instance body/container background colors, font-sizes, font colors, etc.

I have accomplished this by using a stylesheet link to a php file in the header that echo's the CSS and uses get_option.

For instance background-color: <?php echo get_option('background_color'); ?>;

Would I be correct in assuming this is a bad idea performance wise if there are many options?

I have tried other methods but they all seem to add inline or embedded styles, which I do not want, how would one get around this?

Is there any way the settings API can handle this?