Adding comments above Enqueued Styles
-
Is it possible to add HTML comments above styles that are registered and enqueued?
I tried doing it like this but it ends up adding the comment above the whole list of styles instead of just above the font style additions.
// Load styles function techpro_styles() { wp_register_style('normalize', get_template_directory_uri() . '/normalize.css', array(), '1.0', 'all'); wp_enqueue_style('normalize'); wp_register_style('techpro', get_template_directory_uri() . '/style.css', array(), '1.0', 'all'); wp_enqueue_style('techpro'); $marker = '<!-- Google Fonts -->'; echo "\n${marker}\n"; wp_register_style('opensans', '//fonts.googleapis.com/css?family=Open+Sans:400,300,600,700,800'); wp_enqueue_style('opensans'); wp_register_style('lato', '//fonts.googleapis.com/css?family=Lato:400,300,400italic,700,300italic'); wp_enqueue_style('lato'); }
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Adding comments above Enqueued Styles’ is closed to new replies.