Plugin: Options Framework – stylesheets not loading
-
I am using the Options Framework theme https://github.com/devinsays/options-framework-theme within Thematic (and not in a child theme) and all works beautifully except for the selector of alternate stylesheets.
If in functions.php I define the path
define('STYLES', TEMPLATEPATH . '/styles/');
as the creator set up, the list of available stylesheets are visible on the scroll down menu in the admin theme options panel but when selected the style remains the default and no alternate stylesheet is loaded.But if for instance I change the path to
define('STYLES', get_bloginfo('template_url') . '/styles/');
then alternate stylesheets previously selected are loading ok but the scroll down menu of available stylesheets in the admin theme options is blank.Other useful reference may be in theme-options.php
//Stylesheets Reader $alt_stylesheet_path = STYLES; $alt_stylesheets = array(); if ( is_dir($alt_stylesheet_path) ) { if ($alt_stylesheet_dir = opendir($alt_stylesheet_path) ) { while ( ($alt_stylesheet_file = readdir($alt_stylesheet_dir)) !== false ) { if(stristr($alt_stylesheet_file, ".css") !== false) { $alt_stylesheets[] = $alt_stylesheet_file; } } } }
and in admin-functions.php
if (!function_exists('optionsframework_wp_head')) { function optionsframework_wp_head() { global $data; // Alt Styles $alt_style = $data['alt_stylesheet']; if ($alt_style == '') { $alt_style = 'default.css'; } wp_register_style('alt_style', STYLES . $alt_style); wp_enqueue_style('alt_style'); } } add_action('wp_print_styles', 'optionsframework_wp_head');
Any suggestions on where I am going wrong? Thank you.
- The topic ‘Plugin: Options Framework – stylesheets not loading’ is closed to new replies.