Restrict style.css to the dashboard
-
Hi, I would like to prevent the css rules written in the style.css file from taking effect on the dashboard as well.
function theme_enqueue_styles() { // Get the theme data. $the_theme = wp_get_theme(); $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; // Grab asset urls. $theme_styles = "/css/child-theme{$suffix}.css"; $theme_scripts = "/js/child-theme{$suffix}.js"; wp_enqueue_style( 'child-understrap-styles', get_stylesheet_directory_uri() . $theme_styles, array(), $the_theme->get( 'Version' ) ); wp_enqueue_script( 'jquery' ); wp_enqueue_script( 'child-understrap-scripts', get_stylesheet_directory_uri() . $theme_scripts, array(), $the_theme->get( 'Version' ), true ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } //echo('<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js.cookie.min.js"></script>'); } add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Restrict style.css to the dashboard’ is closed to new replies.