Support » Fixing WordPress » get_post_type in functions.php

  • how i can get current post type object name directly in functions.php file?

    $post_type = get_post_type();
    
        $obj = get_post_type_object($post_type);
    
        echo $obj->name;

    Please, help me 🙂

  • The topic ‘get_post_type in functions.php’ is closed to new replies.