I’m fairly new to Sage. I’m building a site which has a custom post type and I want to change the default <title></title> tag, but I can’t work out how to do it nicely.
The post type is for “vehicles”, I have a taxonomy for “make and model” and I’d like the selected taxonomy for each vehicle to be shown in the <title></title> tag instead of the default post title.
Can anyone point me in the right direction? Thanks
Ah, looks like wp_title although still valid and used might not work. It was being deprecated long ago. Then wasn’t, and still exists, but doesn’t do anything? maybe… it should have worked.
Try the document_title_parts hook, which was the replacement and should be better… might even work well for your cases.
$title is an array, you can array_push those title parts on the end, or if you wanted to prefix the title array_unshift