wordprss get post type from id code example
Example 1: wordpres get_posttype
if ( get_post_type( get_the_ID() ) == 'slug_post_type' ) {
//if is true
}
Example 2: get post title by post id wordpress
get_post( $post_id )->post_title
if ( get_post_type( get_the_ID() ) == 'slug_post_type' ) {
//if is true
}
get_post( $post_id )->post_title