Answers for "wordpress get post of post types"

PHP
5

wordpres get_posttype

if ( get_post_type( get_the_ID() ) == 'slug_post_type' ) {
    //if is true
}
Posted by: Guest on June-17-2020
1

wordpress get post type

// Retrieves the post type of the current post or of a given post.
get_post_type( int|WP_Post|null $post = null )
Posted by: Guest on February-19-2021

Code answers related to "wordpress get post of post types"

Browse Popular Code Answers by Language