I’m using Yoast’s WordPress SEO plugin for a variety of websites. In setting title tag templates with his %%category%%
syntax, I’ve figured out that you can reference custom fields by using %%cf_<custom_field_name>%%
.
What I haven’t been able to figure out is how to reference custom taxonomies. Within a custom post type, I have a category that I want to reference (i.e. customcategory
). If I try adding %%customcategory%%
, it doesn’t work. Does anyone know if this is possible with the WordPress SEO plugin or point me in the right direction if I need to add a function to work with the plugin?
You can set a filter for the title elementâs content â hook
'wp_title'
â and add any data you want to it. See this answer for an example.On archives use
get_queried_object()
to detected the taxonomy, on singular views (posts, pages, custom post types) the global$post
is available.Did you try %%ct_%% ? For me its working when added to post titles.