I noticed that after importing a demo, its CSS is still loaded there.
I was wondering wheres the right place to remove this call, from the child theme, since I need to minimize requests and we already loading a dynamic css file there, in which we can integrate the css code from the demo.
Hello,
Sorry but once a demo is loaded the entire demo-style.css file corresponding to that demo will be loaded. If you remove the loading of this file, he demo will no longer receive the specific style. If you do not need to load css, you can simply use the cloud library and import the demo homepage and not use a demo at all on your install.
if you still want to remove the loading of the demo file, you cannot do it from the child theme. you have to modify the main theme files: https://www.screencast.com/t/Z6iibXLf
Thanks
I see. Touching core files is not an option for us (update-wise).
So I was wondering how to recover this situation now. Can I now create a template (cloud one), import it directly and clear the loading somehow?
I mean, I can also copy the demo’s css to dynamic part, but my problem there is the loading call of the file, not the code itself.
Hi,
Yes you can use a tagDiv Cloud Template , and make sure that you do not have any demo install, in this way no demo css will be load ( the demo css is loading only if you have some demo install, if you uninstall it the css will be remove ).
Thank you for your understanding.
Hi,
You need to uninstall the demo, in this way all data/settings of that demo will be remove, if there will be some posts/pages left, you’ll need to delete them manually.
Also maybe you are interested to a Function Reference/wp dequeue style
-> https://codex.wordpress.org/Function_Reference/wp_dequeue_style
-> https://wordpress.stackexchange.com/questions/189985/how-to-properly-dequeue-scripts-and-styles-in-child-theme
Thank you.
Hi,
So you want to remove the demo stylesheet? Kind of unusual. Why would you want to do that exactly? Some demos contain a custom stylesheet with design for various elements which is not possible to do by other means. Removing the stylesheet will remove the custom design.
However if that is what you want to do, use a code like this in either main theme or child theme functions file
function dequeue_demo_style() {
wp_dequeue_style( 'td-theme-demo-style' );
wp_deregister_style( 'td-theme-demo-style' );
}
add_action( 'wp_print_styles', 'dequeue_demo_style', 1002 );
The demo stylesheet should not be loaded anymore after you enter the code.
Thanks
