Hi Keith,
Thank you so much for this, the function works.
How would this be used for CPT? I tried is_singular() and the template name.
There is a minor issue with the conditional statements, in that working off page ID to grab the template, the page needs to be saved first. Ideally I need these fields to be set before content is added if possible.
Any ideas how would this be adapted to run the function on template change?
Rob.