Support » Plugin: Content Views - Post Grid & Filter for WordPress » Hide css if unused(Google Page Issue)

  • Hello,

    Thank you for the plugin. There is one issue when I’m not using the Shortcode on the page. The issue is the unused CSS when I tested it with Google Page Insights. Page Insights recommended to remove it. So, can you update it so that the CSS is removed if not used in a page.

    e.g. [Shortcode] is not used

    Thank you.

Viewing 1 replies (of 1 total)
  • Plugin Author Content Views


    Thank you for contacting us.

    It is possible to unload our CSS if the shortcode is not used on the page.
    Please add this code to file functions.php in the theme’s folder (or install a plugin such as Code Snippets):

    // 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)
  • The topic ‘Hide css if unused(Google Page Issue)’ is closed to new replies.