There was a problem loading the comments.

How to disable default styles loaded with the plugin

Support Portal  »  Knowledgebase  »  Viewing Article

  Print
Deregister default plugin styles

One way to change the default behaviors of WordPress, is using a file named functions.php. It goes in your Theme's folder.
The functions file behaves like a WordPress Plugin, adding features and functionality to a WordPress site through PHP code. You can use it to call native PHP functions, WordPress functions, or to define your own functions, for example function to deregister some plugin's styles :)

You can explore more on functions.php here: https://codex.wordpress.org/Functions_File_Explained

Finding functions.php

To edit the functions.php you will need FTP client to access files on your server or use built-in WordPress editor.
Read more about editing the WordPress files here https://wordpress.org/support/article/editing-files/
While using FTP, navigate to the following directory: wp-content/themes/your-theme-name/functions.php



Editing functions.php

To edit the functions.php via FTP client, use the text editor of your choice (for example: Notepad, TextEditor, Atom, etc.)
After opening the file, go to the place where it ends, and add the following code and save changes.

/**
GDPR CUSTOM CSS START
Add this code to functions.php
**/

// This function deregisters the plugin style.min.css
function ct_ultimate_gpdr_style_css() {
wp_dequeue_style('ct-ultimate-gdpr');
}
add_action('wp_enqueue_scripts', 'ct_ultimate_gpdr_style_css', 100);


/**
- function my_custom_style()
- assets - choose a folder location for your custom css.
- from here you can customize your gdpr-style.css according to your needs or add another css file(wp_enqueue_style() function for you're custom css so that you can override the GDPR font and CSS)
**/
function my_custom_style() {
   wp_enqueue_style( 'client-custom-style', get_template_directory_uri() . '/assets/gdpr-style.css' );
}
add_action( 'wp_enqueue_scripts', 'my_custom_style' );

/** GDPR CUSTOM CSS END**/




How to remove GDPR & CCPA custom fonts

/**
* Remove GDPR CUSTOM FONTS
* - add it to functions.php
*/
function ct_ultimate_gpdr_custom_fonts_css() {
     wp_dequeue_style('ct-ultimate-gdpr-custom-fonts');
}
add_action('wp_enqueue_scripts', 'ct_ultimate_gpdr_custom_fonts_css', 100);

NOTE: Attached you will find gdpr-style.css, which is the default css file of GDPR. You need to copy/upload this to the desired folder so that the GDPR design will still work and you could be able to customize the CSS.

Still not sure how to proceed? Please check the video below:



Attachments


Share via
Did you find this article useful?  

Related Articles

© createIT