Support » Plugin: LuckyWP Table of Contents » Stop CSS loading on homepage?

  • Resolved giacomolaw


    Anyway I can do this? The TOC never loads on the homepage so it is a pointless call to the stylesheet.


Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author LuckyWP


    Hello @giacomolaw !

    Use filters lwptoc_enqueue_style and lwptoc_enqueue_script.


    function disallowTocAssetOnHomePage() {
    	return !is_front_page();
    add_filter('lwptoc_enqueue_style', 'disallowTocAssetOnHomePage');
    add_filter('lwptoc_enqueue_script', 'disallowTocAssetOnHomePage');

    Great, thank you! Love the plugin and the support 😀

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Stop CSS loading on homepage?’ is closed to new replies.