Home > iNove > iNove theme: just one widget position on right sidebar

iNove theme: just one widget position on right sidebar

In the iNove theme you have 4 positions:

  • north_sidebar
  • south_sidebar
  • west_sidebar
  • east_sidebar

but they are all on the right column. Plus, you have some widget hard coded like Recent posts/Random posts, Recent comments, Categories, Blogroll, Archives.

But now in WordPress you have extreme flexibility in what widgets we want to publish or not, so lets adopt it in iNove theme.

Edit


1
/wp-content/themes/inove/sidebar.php

delete everything between


1
<!-- sidebar START -->

and


1
<!-- sidebar END -->

and paste just this


1
2
3
4
5
<!-- sidebar START -->
<div id="sidebar">
    <?php dynamic_sidebar( 'right_column' ); ?>
</div>
<!-- sidebar END -->

Now open


1
/wp-content/themes/inove/functions.php

delete entirely the part after //** widgets */


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/** widgets */
if( function_exists('register_sidebar') ) {
    register_sidebar(array(
        'name' => 'north_sidebar',
        'before_widget' => '<div id="%1$s">',
        'after_widget' => '</div>',
        'before_title' => '<h3>',
        'after_title' => '</h3>'
    ));
    register_sidebar(array(
        'name' => 'south_sidebar',
        'before_widget' => '<div id="%1$s">',
        'after_widget' => '</div>',
        'before_title' => '<h3>',
        'after_title' => '</h3>'
    ));
    register_sidebar(array(
        'name' => 'west_sidebar',
        'before_widget' => '<div id="%1$s">',
        'after_widget' => '</div>',
        'before_title' => '<h3>',
        'after_title' => '</h3>'
    ));
    register_sidebar(array(
        'name' => 'east_sidebar',
        'before_widget' => '<div id="%1$s">',
        'after_widget' => '</div>',
        'before_title' => '<h3>',
        'after_title' => '</h3>'
    ));
}

Instead paste


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/** widgets */
add_action( 'widgets_init', 'my_register_sidebars' );

function my_register_sidebars() {

    register_sidebar(
        array(
            'id' => 'right_column',
            'name' => __( 'Right column' ),
            'description' => __( 'Widgets that will appear on the right column' ),
            'before_widget' => '<div id="%1$s">',
            'after_widget' => '</div>',
            'before_title' => '<h3>',
            'after_title' => '</h3>'
        )
    );

}

Now edit style.css and delete this part


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#centersidebar,
#northsidebar .widget,
#southsidebar .widget {
  background:url(img/widgetsep.png) bottom no-repeat;
  padding:10px 15px 16px;
}
#centersidebar {
  padding-bottom:6px;
}
#northsidebar,
#southsidebar {
  font-size:95%;
}
#northsidebar .widget h2,
#southsidebar .widget h2 {
  margin-bottom:10px;
}
#northsidebar .widget .content p,
#southsidebar .widget .content p {
  margin-bottom:10px;
}
#westsidebar {
  width:121px;
  float:left;
  padding-right:5px;
  font-size:95%;
  overflow:hidden;
}
#eastsidebar {
  width:129px;
  float:right;
  font-size:95%;
  overflow:hidden;
}
#westsidebar h3,
#eastsidebar h3 {
  margin-bottom:5px;
}
#westsidebar .widget,
#eastsidebar .widget {
  margin-bottom:15px;
}

Instead paste


1
2
3
4
5
6
7
8
9
10
.widget {
  background:url(img/widgetsep.png) bottom no-repeat;
  padding:10px 15px 16px;
}
.widget h2 {
  margin-bottom:10px;
}
.widget .content p {
  margin-bottom:10px;
}

Reference: Justin Tadlock – Sidebars in WordPress

 

 

Enjoy :)

Categories: Wordpress, iNove