Sage 9 style Controller for WordPress template hierarchy?

In Sage 9 which I’m familiar with, I could create a controller with the name of the Post Type or Template that I wanted to target, for example SingleMyCustomPostType.php and via the soberwp package the controller would automatically load on the targetted custom post type (my-custom-post-type). Then with protected $acf = true; I could enable auto loading of ACF fields to variable names.

What is the equivalent of the above in Sage 11? I did find a similar question asked in Februrary - Middleware/Controllers for the Template Hierarchy? but it didn’t receive any answers?

Hands up… should have researched this before asking the question - obviously Compsers are the way to go https://roots.io/sage/docs/composers/ and found this solution for the ACF issue in case anyone else needs to know - https://discourse.roots.io/t/solution-how-to-get-acf-fields-on-templates-in-sage10/18086

2 Likes