From 2ef8c257ed40d700e575757b2902fe133634fd28 Mon Sep 17 00:00:00 2001 From: Aadil Ayub Date: Fri, 12 Jan 2024 13:03:34 +0500 Subject: [PATCH] enqueue stylesheet properly --- functions.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/functions.php b/functions.php index a0e564a..5299df4 100644 --- a/functions.php +++ b/functions.php @@ -4,5 +4,7 @@ add_action('init', 'custom_stylesheet'); function custom_stylesheet() { wp_register_style( 'custom-styles', get_template_directory_uri() . '/style.css' ); + wp_enqueue_style( 'custom-styles' ); } -wp_enqueue_style( 'custom-styles' ); \ No newline at end of file + +add_action( 'wp_enqueue_scripts', 'custom_stylesheet' );