I’d like to show the post type of a post, you can do that with get_post_type(), but in my case the names are not pretty (for ex : p_project_plans). So instead I thought I’d show the asociated “menu_name” (as declared with register_post_type), which looks much nicer (for ex : Project plans).
Is there a way to do that ?
Hi @mike23:
This code shows you how to get both singular and plural names (assuming you specified them as such in your
register_post_type()
).Note that the code example is presented as a standalone file you can save as
test.php
file in the root of your website and load in your browser withhttp://yoursite.com/test.php
(assuming you replaceyoursite.com
with your site’s domain!):