active style sheet question(s)

Tagged: 

Author Posts

HigherSourceSites

Notice: this information was written when Microthemer version 2 was current. On Dec 26th, 2014 version 3 was released with a completely new interface. Some of the information may be redundant, but as much of the functionality remains the same in version 3 we haven't deleted this post.

possible feature request –
since it is possible to delete the plugin and lose the style sheet in the plugin’s directory,
perhaps it would be useful to choose where to place the stylesheet, say in the child theme’s directory for css?
I guess one could always copy and paste the active style to the ‘real’ style sheet for the child theme
if one were to remove it, for one reason or another….

so then perhaps another feature request would be to
write an import line to the current style sheet, with that new location.
( yeah, that could be done manually now as well, i am old and lazy)
i guess the loading of the plugin would have to keep track of the new sheet location,
and now we are getting close to actually putting the code directly into the current style sheet.
so i guess i should ask why aren’t we doing that now?


Sebastian

Hello again,

active-styles.css is actually not stored in the plugin directory for the reasons you outline. It’s in /wp-content/micro-themes/. When Microthemer is deactivated or uninstalled this directory, which also stores any exported micro-themes, remains. As do the Microthemer settings in the database.

In fact, some web designers like to uninstall Microthemer when the site goes live for the client and just call the stylesheet from their functions.php file. The following code will only include active-styles.css if Microthemer hasn’t already included it (so the code can always sit in functions.php without causing problems if Microthemer is active):

/* Manually add Microthemer stylesheet */
function add_microthemer_css() {
wp_register_style( 'microthemer', WP_CONTENT_URL . '/micro-themes/active-styles.css');
wp_enqueue_style('microthemer');
}
add_action('wp_enqueue_scripts', 'add_microthemer_css');

Cheers 🙂

Sebastian

You must login or register to reply to this topic.