Home / Disable / Hide sidebar on mobile device
Duplicate Snippet

Embed Snippet on Your Site

Hide sidebar on mobile device

Code Preview
php
<?php
function custom_hide_sidebar_on_mobile() {
    echo '
    <style>
        @media only screen and (max-width: 768px) {
            .sidebar {
                display: none;
            }
        }
    </style>
    ';
}
add_action('wp_head', 'custom_hide_sidebar_on_mobile');

Comments

Add a Comment