404 Not Found on CSS file even though it's in the correct directory
-
23-04-2021 - |
La solution
I don't think using ROOT_PATH is what you want to do here. That loads the server root.
try this code:
//add some pizazz
function pt_load_plugin_css () {
$plugin_url = plugin_dir_url( __FILE__ );
wp_enqueue_style ('pt-style', $plugin_url . 'css/pt.css', '1.0.0');
}
add_action ('wp_enqueue_scripts', 'pt_load_plugin_css');
Licencié sous: CC-BY-SA avec attribution
Non affilié à wordpress.stackexchange