• Here’s the problem: Testing Home page template

    Password is: homepage

    This is a child theme of TwentyTwelve

    I created a new template based on the Front Page template. But for some reason the widgets are not clearing to the bottom of the page. It seems the problem is in the media query and I think to make the Home Page template’s site-content to go full width (and thus clear the widgets to the bottom) I have to register the template in the functions.php file. Yes? How would I register the template?

Viewing 1 replies (of 1 total)
  • this is how it is done in functions.php of the parent theme (very close to the end of functions.php):

    function twentytwelve_body_class( $classes ) {
    
    .....
    
    	if ( is_page_template( 'page-templates/front-page.php' ) ) {
    		$classes[] = 'template-front-page';
    .....
    	return $classes;
    }
    add_filter( 'body_class', 'twentytwelve_body_class' );

    in your child theme’s functions.php you could add:
    (you will need to use the file name of your front page template)

    function twentytwelvechild_body_class( $classes ) {
    
    	if ( is_page_template( 'your_page_template_file_name.php' ) ) {
    		$classes[] = 'template-front-page';
    
    	return $classes;
    }
    add_filter( 'body_class', 'twentytwelvechild_body_class' );

    (untested)

Viewing 1 replies (of 1 total)
  • The topic ‘Creating new page template’ is closed to new replies.