Function Reference/get post type
Description
Retrieve the post type of the current post or of a given post.
Usage
<?php get_post_type( $post ) ?>
Parameters
- $post
- (mixed) (optional) Post object or post ID.
- Default: false
Return Values
- (boolean|string)
- post type or false on failure.
Examples
Notes
- Uses: $wpdb
- Uses: $posts The Loop post global
Change Log
Since: 2.1.0
Source File
get_post_type() is located in wp-includes/post.php.
Related