0

I want to remove a widget area (lateral), and extend the page width getting this area. What is the better way to do it?

Manolo
  • 533
  • 1
  • 9
  • 27

2 Answers2

2

Hook into register_sidebar and remove the sidebar from the global array $wp_registered_sidebars:

add_action( 'register_sidebar', function( $sidebar )
{
    if ( 'lateral' === $sidebar[ 'name' ] )
        unset( $GLOBALS['wp_registered_sidebars'][ $sidebar[ 'id' ] ] );
});

Then adjust the stylesheet or add extra CSS to wp_head to let the page content take the full width.

See also: Change a sidebar name?

fuxia
  • 107,219
  • 39
  • 255
  • 462
0

I've found an easy way:
Simply change your stile.css file.

Replace this code snippet:

 /**
* 5.0 Content
*    ----------------------------------------------------------------------------
*/

.hentry {
padding: 40px 0;
}

.entry-header,
.entry-content,
.entry-summary,
.entry-meta {
margin: 0 auto;
max-width: 604px;
width: 100%;
}

.sidebar .entry-header,
.sidebar .entry-content,
.sidebar .entry-summary,
.sidebar .entry-meta {
max-width: 1040px;
padding: 0 376px 0 60px; 
} 

With this:

 /**
* 5.0 Content
*    ----------------------------------------------------------------------------
*/

.hentry {
padding: 40px 0;
}

.entry-header,
.entry-content,
.entry-summary,
.entry-meta {
margin: 0 auto;
max-width: 1280px;  /* or the maximum resolution that you want*/
width: 100%;
}

.sidebar .entry-header,
.sidebar .entry-content,
.sidebar .entry-summary,
.sidebar .entry-meta {
max-width: 1040px;
padding: 0 20px 0 20px;  /* or the right/left padding that you want */
}

and disable all the aside zone widgets.

Manolo
  • 533
  • 1
  • 9
  • 27