I just want to make it clear that I’m not a sneaky (at least I hope not ) forum users jumping straight to forum questions without even trying or searching first. I assure you I’ve been working a lot on my own, helping other people and done an effort learning both Wordpress, Git, Sage and got to know Gulp and its clear benefits.
Some of these question are more like “confirmations” and to show how I did it and “hopefully” I’ve done’em wrong so I can learn more from Sage and its best practises. So let’s make a better internet
I’ve put Google Analytics straight into the header file. Is this the correct way to do it? Of course I know about the main.js, but since GA JS mostly is inline, I suspect there is another way to do it.
Is the script enqueue system in Sage the same as in WP in general or is there changes made?
Regarding third party plugins not from Bower: is it common practise to add them as vendored in the manifest.json and then enqueue them like this?
wp_enqueue_style(‘owl_carousel’, asset_path(‘styles/owl.carousel.css’), false, null);
wp_enqueue_style(‘owl_carousel2’, asset_path(‘styles/owl.theme.css’), false, null);
wp_enqueue_style(‘owl_carousel3’, asset_path(‘styles/owl.transitions.css’), false, null);
(poor example, since owl is bower, but nevertheless).
There are built-in conditionals for sidebar in lib/config.php. Should the same be done for (for instance) conditional on where a image carousel should appear or not? If not, where should the conditional logic be put?
I could try to just copy display_sidebar() function into display_image_carousel(), but I’m not just sure how this stuff propagate.
Where should additional CDN’s be included?
I wonder what exactly makes the jquery.mmenu (bower) automatically added in the main.scss when sass-mq and jeet isn’t (these are also bower). Just wonder what the engine behind this is.
Where should small settings like new setlocale be put? I need to get correct date from the server. Of course I know I can put in “anywhere”, but obviously I want to do it the best way
And a specific thought about CPT:
I have a CPT (which is as MU plugin) named “stores”. Would the correct file naming and developing process be like this?
- Copy single.php in root and name is single-stores.php (this will be inside a store, viewing a store)
- In single-stores.php then include templates/content-stores.php?
Now; what about the page looping through and listing all the CPT stores (ACF)? Should this be an own template like template-stores.php in root folder?
Sorry, but I have some difficulties gettin wrapping my head around this and get it under my skin. It’s probably the easiest problem in the world, but when I try to optimize my theme and get the most out of it, it would be far better to get the solution and best practise from someone I know is better than me.
Can anyone break it down?
So bear with me on this