• Resolved dfreerider

    (@dfreerider)


    Hi,

    I really like the plugin! And I am considering switching over, but I was wondering if there is a filter to prevent the css file from loading, similar to how you have one for the Javascript?

    It would be very useful for me since I prefer to write my own css, and don’t need the default styles file loaded.

    Thanks!

    -Espen

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author WPJoli

    (@wpjoli)

    Hi,

    Thank you! Well right now there is not filter hook for CSS.

    It could however be added to the next update as it’s no big deal.

    In the mean time, you can try adding these lines of code to your theme’s functions.php to dequeue the Joli TOC styles:

    function dequeue_my_css() {
      wp_dequeue_style('wpjoli-joli-toc-styles');
      wp_deregister_style('wpjoli-joli-toc-styles');
    }
    add_action('wp_enqueue_scripts','dequeue_my_css')

    Cheers!

    Thread Starter dfreerider

    (@dfreerider)

    Hi,

    Thanks for the reply!

    I’m having trouble dequeuing by adding the code to the functions.php. It still adds the css file.

    It works for other style sheets so I can only guess that the code tries to deque the “wpjoli-joli-toc-styles” before the plugin has run its tests to see if a TOC is on the page and enqueues the styles? Does that make sense?

    A filter hook for this would be great!

    -Espen

    Plugin Author WPJoli

    (@wpjoli)

    If this does not work, last thing you could try before I pull an update would be to add a priority number to the hook.

    Like so:
    add_action('wp_enqueue_scripts','dequeue_my_css', 1001)

    If it does not work out, best is to wait until the new filter gets implemented.

    Cheers

    Thread Starter dfreerider

    (@dfreerider)

    Hi,

    I’m afraid it does not work, so I’ll wait for the next update ??

    Thanks

    -Espen

    +1 I would like to still use your custom css intigration to add custom css but dequeue both static css classic.css or other together with the default inlined css. Possible in a future update? ??

    Plugin Author WPJoli

    (@wpjoli)

    You can now disable css & custom styles as of 1.3.8, adding this this to your theme’s functions.php:

    //disables css
    add_filter('joli_toc_disable_styles', function(){ return true; });
    
    //disables inline css & custom styles
    add_filter('joli_toc_disable_inline_styles', function(){ return true; });
    Thread Starter dfreerider

    (@dfreerider)

    Fantastic! That is great news! Thank you ??

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