I see no reason for this to not work technically, only you don’t need those single quotes around variable.
But practically why not just use page-{slug}.php
or other template option from hierarchy?
I see no reason for this to not work technically, only you don’t need those single quotes around variable.
But practically why not just use page-{slug}.php
or other template option from hierarchy?