Created
October 6, 2013 14:09
-
-
Save fredbradley/6854567 to your computer and use it in GitHub Desktop.
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…
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Hello! | |
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( | |
array( | |
'taxonomy' => 'post_tag', | |
'field' => 'slug', | |
'terms' => 'video' | |
) | |
) | |
); | |
query_posts($args); | |
/* Why isn't this working. Any help is of course much appreciated! :) */ | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment