WP_Query in Admin pages lose the Taxonomy
-
I’m unable to select my Custom posts while in the admin section. This is so I can use a related products select box.
My code works fine if it’s being produced for the front-end. Admin pages just do not accept my taxonomy selection argument.
I’ve tried WP_Query, wp_get_recent_posts, and query_posts functions. Please assist.
sample code…function gk_list_recipes_by_cat($call = ''){ global $post; $query = array( 'product_types' => 'Bacon' 'post_type' => 'products', 'posts_per_page' => -1, 'orderby' => 'post_title', 'order' => 'ASC', 'post_status' => 'publish', # 'product_types' => $call ); $queryObject = new WP_Query($query); $related = array(); if ($queryObject->have_posts()) : while ($queryObject->have_posts()): $queryObject->the_post(); $related[$post->ID] = $post->post_title; endwhile; endif; //endforeach; return $related; }
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘WP_Query in Admin pages lose the Taxonomy’ is closed to new replies.