Hi,
the reason we load this plugin on any page is to knowing whether or not current page uses a View, we have to load page’s content before. It means we have to load all assets (styles & scripts) of this plugin at footer.
In this case, we go against one of the best practice advice for optimizing performance is DO NOT load styles at footer – it slows down loading time of a page (even all DOM are loaded, the whole rendering process still hasn’t finished yet because it has to wait for some more styles at footer).
Best regards,
Thanks. So how can we disable it on the homepage?
Please wait. we will send you solution soon.
Hi,
I’m sorry to make you wait.
Here is solution to display CV assets only on page which use Views:
– deactivate and remove CV plugin
– download and install this package http://plugins.svn.wordpress.org/content-views-query-and-display-post-page/branches/dev/content-views-query-and-display-post-page-1.6.8.3.zip
– add this code to file functions.php of your active theme:
// CVPro - Don't load CV at header, load on page which uses View
add_filter( 'pt_cv_default_enqueue_assets', 'my_default_enqueue_assets', 100, 1 );
function my_default_enqueue_assets( $args ) {
$args = false;
return $args;
}
p/s: as I describe above, this action will make layout doesn’t render as smoothly as usual. because it will be re-rendered when CV’s styles are loaded (on footer of page).