Hi @deniscgn Do you mean post name from custom post type by id? Please explain in detail. Happy to help you.
Hello @weboccults
i have created a custom Post Type and gave it the name EVENT and another ohne with VENUE.
Now I have the POST iD and like to get the Post Type Name EVENT or VENUE, By the Post ID I have.
So I can use the name in the post CONTENT.
Hope that makes it clear.
Cheers,
Denis
I think you want something like $name = get_post( $id )->post_type;
$name would be the post type’s slug name used for registration. If you’re after the type’s label (as specified in registration args), it could be extracted from global $wp_post_types, but there could be a more elegant way I’m unfamiliar with.
You cannot drop PHP code directly into content. Dynamic content can be inserted via “the_content” filter, or shortcode, or custom block.