• Skip to primary navigation
  • Skip to main content

Genesis Community

Resources for Genesis WordPress Theme Users

  • Facebook
  • Twitter
  • Slack
  • Wiki
  • Login
You are here: Home / Wikis / WordPress / Close first sidebar widget area in Admim

Close first sidebar widget area in Admim

/** 
 * Close First Sidebar Area
 * @modified from: https://wordpress.stackexchange.com/a/114724/64742
 */
add_action( 'admin_footer-widgets.php' , function(){
    ?>
    <script type="text/javascript">
    jQuery( document ).ready( function( $ ) {
        $( '#widgets-right .widgets-holder-wrap:first' ).addClass( 'closed' );
        $( '#widgets-right' ).css( 'opacity', '1' );
    } );
    </script>
    <?php
} );


//* CSS to hide #widgets-right and then show js above, unless js is disabled
add_action( 'admin_head-widgets.php', function(){
    echo '<style type="text/css">
    #widgets-right {opacity:0;transition: opacity .5s ease-out}
    .no-js #widgets-right {opacity: 1}
    </style>';
} ); 

Posted by: christina Category: WordPress

« DRY Remove Widgets
Get handle for enqueued scripts »

Copyright © 2026 · Genesis Sample on Genesis Framework · WordPress · Log in