Created
April 26, 2021 11:18
-
-
Save zaynali53/9b179e36af6c10d3797bd3de2d7612a1 to your computer and use it in GitHub Desktop.
Enqueue assets in a WordPress Theme
This file contains hidden or 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
| <?php | |
| function enqueue_assets() { | |
| // If using a child theme, auto-load the parent theme style. | |
| if ( is_child_theme() ) { | |
| wp_enqueue_style( 'parent-main', get_template_directory_uri() . '/style.css' ); | |
| } | |
| // Always load active theme's style.css | |
| wp_enqueue_style( 'main', get_stylesheet_uri() ); | |
| } | |
| add_action( 'wp_enqueue_scripts', 'enqueue_assets' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment