40

How to Make WPCodeBox2 Full Width by Hiding the WordPress Menu

Powered by WPCodeBox

This WordPress snippet efficiently hides the default WordPress menu, allowing WPCodeBox2 to expand and utilize the full width of your display area for an optimized and distraction-free coding environment.


<?php 

add_action('admin_head', function(){

if( isset( $_GET['page'] ) && $_GET['page'] === 'wpcodebox2' ) {
    
    echo <<<EOD
    <style type="text/css">
        #adminmenuback {
            margin-left: -160px !important;   
        }
        #wpcontent {
            margin-left: 0px !important;
        }
        #adminmenu {
            display: none;
        }
    </style>
EOD;
}
    
});

Other Snippets

WPCodeBox is a WordPress Code Snippets Manager that allows you to share your WordPress Code Snippets across your sites.