You’re going to need to use something like https://codex.ww.wp.xz.cn/Function_Reference/get_post_type_object to access the description parameter, to the best of my knowledge.
Say you have a post type of “my-type”.
$mytype = get_post_type_object( 'my-type' );
if ( ! empty( $mytype ) ) {
echo $mytype->description;
}
Hi Michael,
So should I place this in my child themes functions.php?
The snippet above, as is, would be used wherever you need to echo the description. It’s not typed up to be a standalone function that you put in a functions.php file.
I’m not aware of any WordPress core function built to display the descriptions, so you’d need to create your own.
function preston_display_post_type_description( $post_type_slug = '' ) {
$mytype = get_post_type_object( $post_type_slug );
if ( ! empty( $mytype ) ) {
echo $the_post_type->description;
}
}
<p><?php preston_display_post_type_description( 'my-type' ); ?></p>
I created a test child theme
copied over index.php and headline.php
added this to headline.php
<?php echo term_description( $term_id, $taxonomy ) ?>
<?php $description = term_description(); ?>
It has given me the description but not the pictures or social media links
Before I saw your code
Note that your provided snippet from 2 replies above is for terms, not post types. Different things here.