wp_enqueue_script() with unknown path and maybe symlink

I think this can help you. I did something similar in one of the plugins I’m developing. static function enqueue_admin_scripts( string $hook_suffix ): void { if ( self::get_page_hook_suffix() !== $hook_suffix ) { return; } $utils_path = self::get_utils_script_path(); if ( ! empty( $utils_path ) ) { wp_enqueue_script( ‘my-plugin-utils’, $utils_path ); } } static function get_utils_script_path(): string … Read more

Proper way to load styles using a child theme

If you want to prevent HELLO from loading it’s own styles, this is the code to paste and adjust in your child theme’s functions.php : function hello_elementor_scripts_styles() { // Dequeue parent theme stylesheets wp_dequeue_style( ‘hello-elementor’ ); wp_deregister_style( ‘hello-elementor’ ); wp_dequeue_style( ‘hello-elementor-theme-style’ ); wp_deregister_style( ‘hello-elementor-theme-style’ ); wp_dequeue_style( ‘hello-elementor-header-footer’ ); wp_deregister_style( ‘hello-elementor-header-footer’ ); // Enqueue only child … Read more

How enqueue CSS out of theme folder?

You can use content_url() to get a URL to the wp-content folder: add_action( ‘init’, function() { wp_enqueue_style( ‘my-tag’, content_url( ‘cssfile.css’ ) ); }); See https://developer.wordpress.org/reference/functions/content_url/

How do I remove Google Fonts from a parent theme?

You may also want to try to deregister the style within your function since it has been register in the parent theme function. Try: function remove_google_fonts_stylesheet() { wp_dequeue_style( ‘pixgraphy_google_fonts’ ); wp_deregister_style(‘pixgraphy_google_fonts’); } add_action( ‘wp_enqueue_scripts’, ‘remove_google_fonts_stylesheet’, 100 );