WordPress.org

Forums

Simple Download Monitor
[resolved] Disable Front-End CSS (8 posts)

  1. X-Raym
    Member
    Posted 10 months ago #

    Hi !

    Apart from editing the main.php file,
    is there a way to disable the front end CSS (admin css is ok) ?

    If not, it would be VERY nice to add this function :)

    thanks for listening !

    https://wordpress.org/plugins/simple-download-monitor/

  2. Josh (WP Edit)
    Moderator and Editor Customizer
    Plugin Contributor

    Posted 10 months ago #

    Hi :)

    When we wrote the shortcode that gets output to the browser; we named each element with a unique html class attribute.

    Here is the code which generates the front-end css:

    if ($fancy == '1') {
    	// Prepare shortcode
    	$data = '<div class="sdm_download_item">';
    	$data .= '<div class="sdm_download_item_top">';
    	$data .= '<div class="sdm_download_thumbnail">'.$isset_download_thumbnail.'</div>';
    	$data .= '<div class="sdm_download_title">'.$isset_item_title.'</div>';
    	$data .= '</div>';//End of .sdm_download_item_top
    	$data .= '<div style="clear:both;"></div>';
    	$data .= '<div class="sdm_download_description">'.$isset_item_description.'</div>';
    	$data .= '<div class="sdm_download_link">'.$download_button_code.'</div>';
    	$data .= '</div>';
    	// Render shortcode
    	return $data;
    }

    You should be able to overwrite any plugin styles by adding new styles via a child theme or custom css plugin. You may need to use the !important declaration, depending on how your css loads.

    Did I understand correctly, or completely miss the point?

  3. X-Raym
    Member
    Posted 10 months ago #

    Oh ovveride the CSS with custom one, it's already what I did :)

    but what I want is to minimze server requests and externals/other files requests.

    So, because I don't use the default theme (here a exemple of what I did, just scroll down to my big impossible to miss dropbox custom button), I think it would be optimium to have an option to disable css loading in the pannel.

    As always, thanks for listening !

    :)

  4. Josh (WP Edit)
    Moderator and Editor Customizer
    Plugin Contributor

    Posted 10 months ago #

    I think it would be optimium to have an option to disable css loading in the pannel.

    Point taken :)

    We'll see if we can't implement this in a future release. Shouldn't be too hard at all.

  5. X-Raym
    Member
    Posted 10 months ago #

    Not in V3 ? :D

  6. Creative Slice
    Member
    Posted 8 months ago #

    Here's a simple solution we used to remove this extra server call. Just add the following to your functions file to deregister the CSS file:

    add_action( 'wp_print_styles', 'my_deregister_styles', 100 );
    function my_deregister_styles() {
    wp_deregister_style( 'dlm-frontend' );
    }

  7. X-Raym
    Member
    Posted 8 months ago #

    Oh yeah !!
    Nice trick, thanks for sharing :)

    I will probably use it from some other plugin I used :D

  8. X-Raym
    Member
    Posted 7 months ago #

    Hi !

    I just found a quick solution for this !

    Use wp_deregister and wp_dequeue wordpress functions !

    here is an explaination

    Here is my code

    add_action( 'wp_enqueue_scripts', 'remove_stylesheets', 25 );
    
    function remove_stylesheets() {
    
        wp_dequeue_style( 'sdm-styles' );
        wp_deregister_style( 'sdm-styles' );
    
    }

    Considered as solved ! :)

    Cheers !

Reply

You must log in to post.

About this Plugin

About this Topic