Hi there,
Not 100% sure this will work, but try this function:
add_action( 'wp_footer', 'tu_clone_sidebar_secondary_navigation' );
function tu_clone_sidebar_secondary_navigation() {
?>
<script>
var target, nav, clone;
nav = document.getElementById( 'secondary-navigation' );
if ( nav ) {
clone = nav.cloneNode( true );
clone.className += ' sidebar-nav-mobile';
target = document.getElementById( 'site-navigation' );
if ( target ) {
target.insertAdjacentHTML( 'afterend', clone.outerHTML );
}
}
</script>
<?php
}
Then add this CSS:
@media (max-width: 768px) {
.gen-sidebar-secondary-nav {
display: none;
}
}