Thanks for quick respons! Ok, so one filter for showing the default element and one filter for showing the “no post” element? Got this to work. Do you se any improvements that could be done?
add_filter( 'generate_element_display', function( $display, $element_id ) {
global $post;
if ( 721 === $element_id && is_post_type_archive('vacant-positions') ) {
if ( $post ){
$display = true;
} else {
$display = false;
}
}
return $display;
}, 10, 2 );
add_filter( 'generate_element_display', function( $display, $element_id ) {
global $post;
if ( 754 === $element_id && is_post_type_archive('vacant-positions') ) {
if ( !$post ){
$display = true;
} else {
$display = false;
}
}
return $display;
}, 10, 2 );