Skip to content

Instantly share code, notes, and snippets.

@aslamatwebdevstudios
Last active April 28, 2023 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aslamatwebdevstudios/e41db3f53ace7d699f38fbea2efc84e5 to your computer and use it in GitHub Desktop.
Save aslamatwebdevstudios/e41db3f53ace7d699f38fbea2efc84e5 to your computer and use it in GitHub Desktop.
Enqueue styles in Theme
<?php
function my_theme_enqueue() {
$version = filemtime( get_stylesheet_directory() . '/css/styles.css' ) ;
wp_register_style(
'my_theme_main_css',
get_template_directory_uri() . '/css/styles.css',
array(),
$version
);
wp_enqueue_style( 'my_theme_main_css' );
}
add_action( 'wp_enqueue_scripts', 'my_theme_enqueue' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment