The function get_post_types( '', 'names' ) returns an array containing the names of post types.

$post_types = get_post_types( '', 'names' ); 
foreach ( $post_types as $post_type ) {
   echo '<p>' . $post_type . '</p>';

Read more here: How can I insert an PHP array into HTML dropdown?


If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Related Wordpress search:

, , , ,

Wordpress related questions and answers: