Quando, associamos a taxonomia padrão do wordpress (tags) à um post-type personalizado, os posts desse post-type não são listados na página tag.php. Para resolver isso, basta colocar essa função no arquivo functions.php:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
function wpse28145_add_custom_types( $query ) { if( is_tag() && empty( $query->query_vars['suppress_filters'] ) ) { // this gets all post types: $post_types = get_post_types(); // alternately, you can add just specific post types using this line instead of the above: // $post_types = array( 'post', 'your_custom_type' ); $query->set( 'post_type', $post_types ); return $query; } } add_filter( 'pre_get_posts', 'wpse28145_add_custom_types' ); |