Hi there,
I’m having a issue showing a custom header on the second language.
In the main language i’ve built few header which will load on all posts of a certain category.
It works fine but in the second language of the post i don’t get the cutom header.
I saw a solution of placing this code in functions but it doesn’t work for me, actually it doesn’t show the header on both language.
add_filter( 'generate_header_element_display', 'wpml_generate_header_element_display_filter', 10, 2 );
function wpml_generate_header_element_display_filter( $display, $post_id ) {
$current_language = apply_filters( 'wpml_current_language', null );
$element_language = apply_filters( 'wpml_element_language_code', null, array(
'element_id' => $post_id,
'element_type' => 'post_gp_elements'
)
);
if ( $current_language != $element_language ) {
$display = false;
}
return $display;
}
I’m using your latest version of the theme and all plugins updated.
WP 5.0.2
Ps. the posts are only in italian and I’m showing them as translated in english with the WPML option
Thanks