function add_theme_support( $feature ) {}

Allows a theme to register its support of a certain feature
Must be called in the theme’s functions.php file to work. If attached to a hook, it must be after_setup_theme. The init hook may be too late for some features.


  • string $feature: the feature being added

Source code

function add_theme_support( $feature ) {

	global $_wp_theme_features;

	if ( func_num_args() == 1 )

		$_wp_theme_features[$feature] = true;


		$_wp_theme_features[$feature] = array_slice( func_get_args(), 1 );

	if ( $feature == 'post-formats' && is_array( $_wp_theme_features[$feature][0] ) )

		$_wp_theme_features[$feature][0] = array_intersect( $_wp_theme_features[$feature][0], array_keys( get_post_format_slugs() ) );



No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: