How to correctly register/enqueue

[ad_1]

Hi. I am developing my website as a wp child theme.

I have a db with products and accessories and a couple of view templates to show details. I’m unsure if my design is correct.

I have these CSSs:
– `style.css` which overload some parent theme settings
– a global CSS, common to all my pages
– other stylesheets specific to each detail views

My idea:
– enqueue `style.css` and my global CSS in `functions.php`
– register everything else at hook `wp_loaded` in `functions.php`
– enqueue specific scripts/styles directly in each php template

Is this ok? My goal is to be “correct”.

[ad_2]
1 Comment
  1. I usually enqueue specific scripts/styles per shortcode or per page type/id. The style.css from the theme does not have to be enqueued at all, except if you have some real css in it except the comments.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer