Last active
April 14, 2020 05:55
-
-
Save nat-c/bc3b47649b0c1e2a6eed to your computer and use it in GitHub Desktop.
Remove Monarch Plugin "Open Sans" stylesheet : Code snippet to add to your CHILD Theme's functions.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // <--- you don't need to include this. Your functions.php file already starts with it. | |
/** We need to include this line, otherwise the "if is plugin active" check won't work **/ | |
include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); | |
/** | |
* Create (and name) a function | |
* to load your parent's stylesheet, (it's much better than the "@import" method!) | |
* any extra styles, and of course to remove styles as well | |
**/ | |
function nc_my_custom_styles() { | |
wp_enqueue_style('parent-style', get_template_directory_uri() . '/style.css'); | |
wp_enqueue_style('child-style', get_stylesheet_directory_uri() . '/style.css', array('parent-style')); | |
if ( is_plugin_active( 'monarch/monarch.php' ) ) { | |
wp_dequeue_style( 'et_monarch-open-sans' ); | |
} | |
} | |
add_action('wp_enqueue_scripts', 'nc_my_custom_styles'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment