Hi guys,
I’m facing an issue with Author Boxes appearing on Search Results.
Here are two examples:
– https://www.ispeakspokespoken.com/?s=toeic
– https://www.ispeakspokespoken.com/?s=present+perfect
To display the author boxes, I’m using a PHP snippet that you gave me previously:
add_filter( 'generate_element_display', function( $display, $element_id ) {
global $post;
$author = get_post_field( 'post_author', get_the_ID() );
if ( 21598 === $element_id && '54' === $author || 23592 === $element_id && '32' === $author || 23590 === $element_id && '50' === $author || 23591 === $element_id && '45' === $author ) {
$display = true;
}
return $display;
}, 10, 2 );
So, even if I exclude the author boxes from the search results on the settings, it won’t work.
Could you please help me with that?
Thanks a lot,
Adrien