Just an update, I used a plugin to show Related Posts on custom post. I hope you can provide a snippet so that I can uninstall the plugin.
Hi @alonagomez,
Please try the following snippet
add_filter( 'astra_related_posts_supported_post_types', 'ast_add_related_posts_cpt_support' );
function ast_add_related_posts_cpt_support( $post_types ) {
$post_types = array(
'post',
'my-cpt-1'
);
return $post_types;
}
You need to change the my-cpt-1 to your CPT, of course.
I hope it helps.
Kind regards,
Herman 😊
Thanks it worked but it shows all the custom posts. Can you add more code to show the same custom category.
Hi @alonagomez,
It will inherit from the Related Post section under Blog > Single Post section on the Customizer. There’s an option to show the Related Post by Categories or Tags.
Further, I would like to let you know that, actually, customization/ custom code is something that we are not offering to support.
Maybe there will be someone in the community who knows how to code, will share a thought here.
Kind regards,
Herman 😊