Theme Support

Theme Support is a map of the WordPress add_theme_support function (ref:https://developer.wordpress.org/reference/functions/add_theme_support/) with some additional benefits.

You can add any theme support options in this section.

For example:

add_theme_support( 'title-tag' );

Would be added to porter.json as follows:

{
    ...
        "settings" : {
            "theme-support" : {
                "title-tag" : true
            }
        }
}

Whereas a more complex example might be post thumbnails, which would change from this:

add_action( 'after_setup_theme', 'wpdocs_theme_setup' );
function wpdocs_theme_setup() {
	add_image_size( 'category-thumb', 300, 300 );
	add_image_size( 'homepage-thumb', 220, 180, true );
}

To this:

...
	"theme-support" : {
		...
		"post-thumbnails" : {
			"category-thumb" : {
				"width" : 300,
				"height" : 300
			},
			"homepage-thumb" : {
				"width" : 220,
				"height" : 180,
				"crop" : true
			}
		}
	}
...

Last updated