• Resolved holdenandmason

    (@holdenandmason)


    N00b question.

    I created a child theme. I copied the nosidebar template and called it NSB. However, when I use my template it still shows a vertical line where the sidebar normally is. How do I fix that?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Theme Author Takao Utsumi

    (@utsumit)

    Hi, did you change nosidebar.php to nsb.php? If yes, you should add this code in child theme’s functions.php.

    function graphy_child_body_class( $classes ) {
    	if( is_page_template( 'nsb.php' ) ) {
    		$classes[] = 'no-sidebar';
    		foreach( $classes as $key => $val ) {
    			if ( 'has-sidebar' == $val ) unset( $classes[$key] );
    		}
    	}
    	return $classes;
    }
    add_filter('body_class', 'graphy_child_body_class', 20);
    Thread Starter holdenandmason

    (@holdenandmason)

    Thanks. Works perfectly

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Nosidebar template in child theme’ is closed to new replies.