Support » Plugin: Content Views - Post Grid & List for WordPress » CSS loads on every page of website

  • joshuamayo

    (@joshuamayo)


    Hi,

    I noticed after running some tests using Google Page Speed that your plugin’s stylesheet and Javascript loads on every page of the website instead of the page it’s actually being used on. Is there any way to prevent this? It’s not great for website speed and optimization.

    • This topic was modified 3 months ago by joshuamayo.
Viewing 1 replies (of 1 total)
  • Plugin Author Content Views

    (@pt-guy)

    Hello,
    Thank you for contacting us.

    Yes, it is possible. Please add this code to file functions.php in the theme’s folder (or install the plugin “Code Snippets” then add this code):

    
    // Content Views - Only load if there are Views on page
    add_filter( 'pt_cv_default_enqueue_assets', '__return_false' );
    

    Best regards,

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.