Hi there,
I’m trying to apply a custom header / footer to a post type. In my case it is a custom post type called “Event”.
It’s not working. If I go into the settings for a header or footer and add a condition based on Post Type = Event.
But yet if I put a dynamic value into a text box on the post type’s layout it displays “Event”. Also if I change the condition on the header / footer to “Event Status = published” it works. So I’m at a bit of a loss as to why this isn’t working.
It’s working for other custom post types on my site, just not events.
This is the code for my custom post type:
add_action('init', function(){
register_post_type('event',
array(
'labels' => array(
'name' => __( 'Events', 'textdomain' ),
'singular_name' => __( 'Event', 'textdomain' ),
),
'supports' => array('title', 'editor', 'thumbnail', 'page-attributes'),
'show_ui' => true,
'show_in_menu' => true,
'menu_icon' => 'dashicons-calendar',
'public' => true,
'has_archive' => true,
'rewrite' => array( 'slug' => 'event' ),
'publicly_queryable' => true,
'menu_position' => 2,
'exclude_from_search' => false,
'show_in_rest' => true
)
);
flush_rewrite_rules();
});
Any ideas what I’m doing wrong?
Thanks!