A way to avoid loading assets on non-recipe posts/pages
-
Hi, what is the best way to avoid loading the frontend assets on pages where I don’t need them?
Or what code do I need to dequeue the styles and scripts when I don’t need them?
Thanks for any help
private function define_public_hooks() { $plugin_public = new Frontend\Frontend( $this->get_plugin_name(), $this->get_version() ); // Enqueue the scripts and stylesheets $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' ); $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' );
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘A way to avoid loading assets on non-recipe posts/pages’ is closed to new replies.