You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a starter theme, I understand _s shouldn't be complex. However, while developing the functions.php file keeps growing in lines as you make more conditions for enqueuing style and scripts to particular page templates for example. With the issue above and gutenberg coming shortly, I see that the need to enqueue style and scripts for WP blocks while the functions.php becomes a little unreadable - my thought again. However, if we split the file according to functionality as the other file splits in the inc folder, we can achieve some consistency and more readability.
I hope this is helpful for many. Please share your thoughts. If its a green light can whip up a PR for that.
The text was updated successfully, but these errors were encountered:
Hi @bahiirwa! Thank you for submitting this issue, and explaining the reasoning behind it.
I can see how this could help with more complicated themes that have a lot of enqueues. But _s itself is pretty basic, and this could be overkill for the simpler themes people build with it.
Right now, I think this is something that should be done on a theme-by-theme basis, when a theme’s complexity calls for it. But it's something we could revisit with _s if it does become more complex in the future!
I am hoping to add some readability to the functions.php file by splitting the file into two files.
Why?
I saw a pattern of thought similar to what I go through developing with
_s
as I was reading WordPress/gutenberg-starter-theme#36.As a starter theme, I understand
_s
shouldn't be complex. However, while developing the functions.php file keeps growing in lines as you make more conditions for enqueuing style and scripts to particular page templates for example. With the issue above and gutenberg coming shortly, I see that the need to enqueue style and scripts for WP blocks while the functions.php becomes a little unreadable - my thought again. However, if we split the file according to functionality as the other file splits in theinc
folder, we can achieve some consistency and more readability.I hope this is helpful for many. Please share your thoughts. If its a green light can whip up a PR for that.
The text was updated successfully, but these errors were encountered: