Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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?

share|improve this question
Any luck on trying to figure this out? – user14164 Mar 15 '12 at 1:25

1 Answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.