Adding support for features like post author link and comments to Custom Post Types in Genesis

With the current version of Genesis (3.3.1) and Genesis Sample (3.3.0), post author post link will not appear in the entry header’s entry meta for CPTs.

If you want to output the post author link after “by” we need to add support for author to the CPT.

Here are two ways in which this can be done.

Method 1

In /wp-content/themes/genesis-sample/config/post-type-supports.php change

return [
	'post' => [
		'genesis-singular-images',
	],
	'page' => [
		'genesis-singular-images',
	],
];

to

return [
	'post' => [
		'genesis-singular-images',
	],
	'page' => [
		'genesis-singular-images',
	],
	'testimonial' => [
		'author',
	],
];

where testimonial is the name of the custom post type.

If you want to also add support for comments, make it:

return [
	'post' => [
		'genesis-singular-images',
	],
	'page' => [
		'genesis-singular-images',
	],
	'testimonial' => [
		'author',
		'comments',
	],
];

Note: You would still need to tick “Allow comments” under the Discussion section when editing the CPT entry.

Method 2

Add this in functions.php:

add_post_type_support( 'testimonial', 'author' );
This site uses cookies to offer you a better browsing experience. By browsing this website, you agree to our use of cookies.