Home › Forums › Weaver Xtreme Theme › How to disable theme options
- This topic has 2 replies, 2 voices, and was last updated 11 years, 4 months ago by
Tigermama.
-
AuthorPosts
-
May 1, 2015 at 12:59 UTC - Views: 1 #17702
Tigermama
ParticipantHi… For several reasons, I would prefer not to load the theme options (/ custom) css and instead just use my child theme’s style.css. Can this be done, and how?
Disclaimer: I know that this is one of the main features of Weaver – but I appreciate its internal structure so much more than all the css options.Thanks, TigermamaMay 1, 2015 at 16:05 UTC - Views: 6 #21777Weaver
KeymasterAdd this code to your child’s functions.php. You can modify as you see fit. It is commented. It will effectivdely replace the equivalent code in the main theme’s functions.php by redefining the included actions.
add_action(‘wp_head’, ‘weaverx_no_generated_stylesheet’,7);
function weaverx_no_generated_stylesheet() {
// this will not include the generated stylesheet from Weaver X-Plus.
wp_dequeue_style(‘weaverxp-style-sheet’);
}add_action(‘get_header’, ‘my_fix_actions’); // need to do this BEFORE wp_head actions, thus get_header
function my_fix_actions() {
remove_action(‘wp_head’, ‘weaverx_wp_head_early’,7);
add_action(‘wp_head’, ‘weaverx_new_wp_head_early’,6);
}function weaverx_new_wp_head_early() {
// Add stylesheets
// need the following for genericons
$sheet = get_template_directory_uri() . ‘/assets/css/fonts’.WEAVERX_MINIFY.’.css’;
wp_enqueue_style(‘weaverx-font-sheet’,$sheet,array(),WEAVERX_VERSION,’all’);// Start with the “real” stylesheet (so child theme style.css can override)
// comment out the next to to not use theme’s stylesheet
$sheet = get_template_directory_uri() . ‘/assets/css/style-weaverx’.WEAVERX_MINIFY.’.css’;
// comment out the following to remove the standard style-weaverx.css style sheet.// wp_enqueue_style(‘weaverx-style-sheet’,$sheet,array(‘weaverx-font-sheet’),WEAVERX_VERSION,’all’);
if ( is_child_theme() ) { // don’t bother with empty main style.css
$sheet_dev = get_stylesheet_directory_uri() . ‘/style.css’; // get style.css
$sheet = str_replace(‘.css’, WEAVERX_MINIFY.’.css’,$sheet_dev); // default sheet
$sheet_file = get_stylesheet_directory() . ‘/style’ . WEAVERX_MINIFY . ‘.css’;
if (! @file_exists($sheet_file))
$sheet = $sheet_dev; // no style.min.css available (need this check for child themes)wp_enqueue_style( ‘weaverx-root-style-sheet’, $sheet, array(‘weaverx-style-sheet’), WEAVERX_VERSION, ‘all’);
}
}May 1, 2015 at 17:35 UTC - Views: 1 #21778Tigermama
ParticipantVery cool, thank you.
-
AuthorPosts
- You must be logged in to reply to this topic.

