Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Contributor Josh

    (@josh401)

    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?

    Thread Starter X-Raym

    (@x-raym)

    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 !

    🙂

    Plugin Contributor Josh

    (@josh401)

    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.

    Thread Starter X-Raym

    (@x-raym)

    Not in V3 ? 😀

    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' );
    }

    Thread Starter X-Raym

    (@x-raym)

    Oh yeah !!
    Nice trick, thanks for sharing 🙂

    I will probably use it from some other plugin I used 😀

    Thread Starter X-Raym

    (@x-raym)

    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 !

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Disable Front-End CSS’ is closed to new replies.