Good Day,
I’m new to creating custom post types and need some assistance.
I’m creating user submitted posts via WP Forms, ACF Pro and CPT UI.
And have pretty much gotten everything to work.
Filled in forms are being correctly displayed as posts by including the following code in my functions.php file.
/** Add Global Block to Casting Posts */
function add_global_post() {
if(in_category('castings')){
echo do_shortcode('[cs_gb name="casting-info"]');
}}
add_action( 'x_after_the_content_end', 'add_global_post', 10 );
However, I’ve had to create an additional Custom Post Type called ‘Castings’ and gave the CPT a category called ‘auditions’
But when updating the functions.php file to use the new category, It doesn’t display the global block on the newly created posts. (See code below),
/** Add Global Block to Casting Posts */
function add_global_post() {
if(in_category('auditions')){
echo do_shortcode('[cs_gb name="casting-info"]');
}}
add_action( 'x_after_the_content_end', 'add_global_post', 10 );
I’ve tried updating the line to say
'if{in_casting_category('auditions')){
But with no success.
I’ve spent the last two days trying to figure out how to do this by myself but with no avail.
I was hoping to could take a moment, and let me know what I am doing wrong.
Also, I’ve noticed that the new Custom Post Type is not displaying the meta icons (or category icons) in the new posts. Any guidance on how I can get them to show up in the new post type would be much appreciated.
Thank you and regards,
Julius
