• I’m trying to create a child theme based on twenty twenty and want to use the full width styles. However, when I base it off the singluar.php file, its using the thin styles, not the full width. I can’t locate how the theme is adding the class name to set the width. Anyone familiar enough with the twenty twenty theme to know where I can set the content width to use the full width styles? I’m gone through the functions file as well as the template files and can’t determine how this is dynamically set.

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • It adds the code for the full width here:

    https://themes.trac.wordpress.org/browser/twentytwenty/1.1/inc/template-tags.php#L641

    Which is based upon if the template for the post is set to Full Width or not.

    Thread Starter greencrest

    (@greencrest)

    Thanks. I’m assuming I just create a template-tags file within the child theme folder with what I want to modify?

    • This reply was modified 6 years, 4 months ago by greencrest.
    Thread Starter greencrest

    (@greencrest)

    I duplicated the template-tags.php file and added this code:

       	// Check whether the current page has full-width content.
    	if ( is_page_template( array( 'templates/front-page.php' ) ) ) {
    		$classes[] = 'has-full-width-content';
    	}

    But the home page isn’t adding the template-full-width class to the home page. Any idea what I’m doing wrong?

    There isn’t a front-page.php template unless you added one and have that set as the template for your homepage. You would probably have to try something like the is_home() function and add the class that way.

    Thread Starter greencrest

    (@greencrest)

    Thanks.

    • This reply was modified 6 years, 3 months ago by greencrest.
Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘creating child theme’ is closed to new replies.