Query multiple taxonomy in Custom Post Type

There’s the “tax_query” argument available since the latest wp release: global $query_string; $args[‘tax_query’] = array( array( ‘taxonomy’ => ‘status’ ,’terms’ => array( ‘available’, ‘pending’ ) // change to “sold” for 2nd query ,’field’ => ‘slug’ ), ); $args[‘post_type’] = ‘listing’; parse_str( $query_string, $args ); $avail_n_pend = query_posts( $args ); if ( $avail_n_pend->have_posts() ) : while … Read more

Menu with Automatic Pages Included from Custom Post Type

This is accomplished by _wp_auto_add_pages_to_menu() (in \wp-includes\nav-menu.php) function that is hooked to transition_post_status hook. Unfortunately it is hardcoded for page post type and is not easy to extend. On other hand since it works through generic hook it isn’t hard (relatively, menus internal code is pain) to engineer analogue for custom post type.

Setting a title on a Custom Post Type that doesn’t support titles

You could add a hidden input into the page to pre-set the title field, because it won’t be on the page(because the type doesn’t support titles). Slug is produced from the title, so you should only need add a title value. Something like this should work(though untested).. add_action( ‘submitpost_box’, ‘hidden_type_title’ ); function hidden_type_title() { global … Read more