WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This has been bugging me for the best part of a day now, so I'm appealing to help in order to calm my nerves.

I run a site that has many custom post types. Every post type shares the use of the post_tag taxonomy.

I need to create a page that shows all the posts that are tagged with "video". It's not working like I expect. It's only showing the normal blog posts - not the other custom post types that are also tagged with 'video'.

Below is the code that I've got. For reference the function get_bonn_post_types is an array of all the post types on my install.

$args = array(
'post_type' => array(get_bonn_post_types()),
'tax_query' => array(
        'taxonomy' => 'post_tag',
        'field' => 'slug',
        'terms' => 'video'

Why isn't this working. Any help is of course much appreciated! :)

share|improve this question
get_bonn_post_types returns an array, and you're inserting that into another array? – Milo Oct 6 '13 at 14:10
Yep - that'll do it! Thanks Milo! This is why I shouldn't code when I'm tired! #SchoolBoyErrors Carry on. – Fred Bradley Oct 6 '13 at 14:37

Your Answer


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

Browse other questions tagged or ask your own question.