Get all the registered Post Types in WordPress

How to Get all the registered Post Types in WordPress. This is a small piece of code to retrieve all registered post types in WordPress. When ever if you want to know what are the post types registered in WordPress. Just add this code to any theme files.

Add this code to header.php or footer.php in Theme files.

$post_types=get_post_types(); 
print_r($post_types);

Check Your Website Rankings

Vivek Vengala
 

Vivek Vengala is a Online Entrepreneur, Web Developer from Hyderabad India.

Click Here to Leave a Comment Below 0 comments

Leave a Reply: