fosterbydesign
Forum Replies Created
-
OK, I tracked it down in case anyone else finds this useful.
It appears that ‘page’ will not work as a “simple” taxonomy query.
Instead of this:
'page' => 'my-test-page'I used this:
'tax_query' => array( array( 'taxonomy' => 'page','field' => 'slug', 'terms' => 'my-test-page'))Hope that helps!
–Mark
Thanks for the fast response!
For my purposes (adding ‘page’ checkmarks while editing a ‘resource’ post), I needed to reverse ‘resources’ and ‘page’ in your register call.
Now editing a resource works as expected. And that’s awesome.
Small issue remains:
When I use WP_Query to list all Resources that contain a ‘page’ with the current page slug name, it is returning all resources. This is ONLY happening on ‘page’ – the same exact code works for all other custom post types I’ve created.
It sounds like the bug they fixed in WordPress 3.5:
http://core.trac.ww.wp.xz.cn/ticket/20604Any ideas?
Here is a small snippet:
global $post;
$args = array (
‘posts_per_page’ => ‘-1’,
‘post_type’ => ‘resource’,
‘orderby’ => ‘menu_order’, ‘order’ => ‘ASC’,
‘page’ => ‘my-test-page’
);
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();// Some posts (i.e. resources) come back with the ‘page’ taxonomy empty, despite the filter above – which should not be happening.
Appreciate any pointers!