Hi Yassine,
Can you try this for the left sidebar instead?:
add_action('generate_before_comments', 'inser_sidebar_before_comment');
function inser_sidebar_before_comment() {
if ( is_single() && wp_is_mobile() ) {
return get_sidebar( 'left' );
}
}
If you wish both to appear there, you can try:
add_action('generate_before_comments', 'inser_sidebar_before_comment');
function inser_sidebar_before_comment() {
if ( is_single() && wp_is_mobile() ) {
return get_sidebar( 'left' ) + get_sidebar();
}
}
Kindly let us know how it goes. 🙂