File tree Expand file tree Collapse file tree 4 files changed +21
-2
lines changed
Expand file tree Collapse file tree 4 files changed +21
-2
lines changed Original file line number Diff line number Diff line change 1+ /* Add your own styles here */
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ public function __construct() {
2626 add_action ( 'after_setup_theme ' , [ $ this , 'theme_supports ' ] );
2727 add_action ( 'init ' , [ $ this , 'register_post_types ' ] );
2828 add_action ( 'init ' , [ $ this , 'register_taxonomies ' ] );
29+ add_action ( 'wp_enqueue_scripts ' , [ $ this , 'enqueue_styles ' ] );
2930
3031 add_filter ( 'timber/context ' , [ $ this , 'add_to_context ' ] );
3132 add_filter ( 'timber/twig/filters ' , [ $ this , 'add_filters_to_twig ' ] );
@@ -35,6 +36,19 @@ public function __construct() {
3536 parent ::__construct ();
3637 }
3738
39+ /**
40+ * This enqueues theme styles.
41+ */
42+ public function enqueue_styles () {
43+ $ main_stylesheet = '/assets/styles/main.css ' ;
44+ wp_enqueue_style (
45+ 'timber-starter-style ' ,
46+ get_template_directory_uri () . $ main_stylesheet ,
47+ [],
48+ filemtime (get_template_directory () . $ main_stylesheet )
49+ );
50+ }
51+
3852 /**
3953 * This is where you can register custom post types.
4054 */
Original file line number Diff line number Diff line change 22 * Theme Name: My Timber 2.x Starter Theme
33 * Description: Starter Theme to use with Timber
44 * Author: Timber Team and You!
5- */
5+ */
6+
7+ /* NOTE:
8+ * This file is reserved for the theme metadata and is not loaded.
9+ * Write styles in assets/styles/main.css instead.
10+ */
Original file line number Diff line number Diff line change 11<head >
22 <meta charset =" {{ site .charset }}" />
3- <link rel =" stylesheet" href =" {{ site .theme .link }}/style.css" type =" text/css" media =" screen" />
43 <meta name =" viewport" content =" width=device-width, initial-scale=1" />
54 <link rel =" author" href =" {{ site .theme .link }}/humans.txt" />
65 <link rel =" profile" href =" http://gmpg.org/xfn/11" />
You can’t perform that action at this time.
0 commit comments