Disable CSS specific page

I want disable one specific page of the default css, and i want use my css on the specific page. I don't know it is posibble?

I use Blank State plugin, for create blank page, but css its on the blank pages, but i want my css use on the specific blank pages.

https://wordpress.org/plugins/blank-slate/

So, i have one page, that name: test-area-7 Code:

add_action('wp_enqueue_scripts', 'my_script', 99);
function my_script()
{
    if(is_page( 'test-area-7' )){
        wp_dequeue_script('fpw_styles_css');
    }
}

EDITED

    add_action('wp_enqueue_scripts', 'my_script', 99);
function my_script()
{
    if(is_page( 'test-area-7' )){
        wp_dequeue_script('/wp-content/themes/colormag/style.css');
    }
}

Topic css Wordpress

Category Web


instead of denqueue_script, why not put the conditional "if not the page" then "load my css"

function theme_styles() {
  if(!is_page( 'your-page-slug' )){
     wp_enqueue_style('theme-stylesheet', get_template_directory_uri() .'/assets/css/main.css');
  }else{
    wp_enqueue_style('my-custom-page-css', get_template_directory_uri() .'/assets/css/custom.css');
  }
add_action('wp_enqueue_scripts', 'theme_styles');

Place that in functions.php and should work. Not tested that though.


Disable CSS specific page for use conditional tag.

add_action('wp_enqueue_scripts', 'my_script', 99);
function my_script()
{
    if(is_page( 'Page name' )){
        wp_dequeue_script('fpw_styles_css');
    }
}

EDIT

 wp_dequeue_script('Your css name or id');

EDIT

Please check this link for more :

https://developer.wordpress.org/reference/functions/wp_enqueue_style/

How to use wp_dequeue_style() for style enqueued in WP_Widget class

 wp_enqueue_style( 'my-theme-ie', get_stylesheet_directory_uri() . "/css/ie.css");
wp_dequeue_script('my-theme-ie');

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.