Custom Post didn’t display on tags page

WordPress tags only display default posts on their page. In order to display custom post type in tags page, you will have to add your post type in default query of the tag.

Add below code in your functions.php and add custom post types in $post_types array which you want to display on tags page.

function add_custom_types_to_tax( $query ) {
    if( is_tag() && empty( $query->query_vars[‘suppress_filters’] ) ) {

        // Get all Custom Post types
        //$post_types = get_post_types();

        // Get Specific Custom Post types
        $post_types = array( ‘post’, ‘your_custom_type’ );

        $query->set( ‘post_type’, $post_types );

        return $query;
    }
}
add_filter( ‘pre_get_posts’, ‘add_custom_types_to_tax’ );

Hope this helps..!!

error code: 523