18

How to Make WPCodeBox Full-Width by Hiding the WordPress Menu

Powered by WPCodeBox

This WordPress snippet effectively hides the WordPress admin menu, allowing WPCodeBox to expand and utilize the full width of your screen, enhancing your code editing experience.


<?php 

add_action('admin_head', function(){

if( isset( $_GET['page'] ) && $_GET['page'] === 'wpcb_menu_page_php' ) {
    
    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.