This is searchable archive of our old support forums, which operated from 2012 - 2016. To find out how to get support for your current theme, please visit our support page.

Reply To: Dynamically Generate Static CSS with PHP

Jason Bobich

Hello John,

Sure, why not? But this all comes back to the original problem iphoenix was having. When you’re creating these WordPress plugins and child theme customizations, you need to be aware of the order in which everything is being loaded.

Any way to make themeblvd_get_option_name work in a plugin?

In this example, you’re simply asking about using a function that is present in the theme. Well, since WordPress includes plugin files before theme files, you simply couldn’t call functions from the theme out in the open from your plugin’s files because the theme’s files haven’t been included yet.

In this case, you could pick a hook that is “after_setup_theme” or later and hook your function to that. Example:

function do_something(){
	// Now you can use functions from the theme hereā€¦
add_action( 'after_setup_theme', 'do_something' );