Last active
June 21, 2023 21:18
-
-
Save andrii-kvlnko/e1e8a24dec2b71973344b39ea26a4370 to your computer and use it in GitHub Desktop.
Enqueue scripts and styles from upload directory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'wp_enqueue_scripts', function() { | |
$wp_upload_dir = wp_upload_dir(); | |
$base_url = $wp_upload_dir['baseurl']; | |
$base_dir = $wp_upload_dir['basedir']; | |
wp_enqueue_style( | |
'howlife-style', | |
sprintf( '%s/example/css/main.css', $base_url ), | |
[], | |
filemtime( sprintf( '%s/example/css/main.css', $base_dir ) ) | |
); | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment