Theme Support Generator


Use this tool to create custom code for Theme Features with add_theme_support() function.


  • Fill in the user-friendly form.
  • Click the “Update Code” button.
  • Copy the code to your project.
  • Or save it as a snippet and share with the community.


If you are still learning how to use this tool, check out the following examples:

The function used in the code.
Add Child Themes Support.
Enable Content Width definition. Maximum allowed width for content in the theme.
Set up the content width value (px) based on the theme's design.
Enable Post Formats to customize the content presentation in the theme.
Enable Featured Image support.
Apply thumbnails for those post types
Comma separated list of Post Types.
Set custom width and height for thumbnails.
Custom image width and height.
Enable Custom Background support
Set default background color.
Set default background image
Set default background image repeat.
Set default background image position-x.
WordPress head callback function.
Admin head callback function.
Admin preview callback function.
Enable Custom Header image support.
Default header image. Full URL.
Header image width & height.
Allow flexible width & height.
Allow to upload other header images.
Allow random image rotation.
Display default header text.
Default header text color.
WordPress head callback function.
Admin head callback function.
Admin preview callback function.
Support custom videos as headers.
Callback used to determine whether the video should be shown for the current request.
Enable Semantic Markup to improve theme HTML5 markup.
Enable Title Tag support in HTML .
Enable TinyMCE Editor Style to customize the content presentation in the visual editor.
Path to the stylesheet file, relative to the theme directory.
Enable internationalization.
Unique identifier for retrieving translated strings.
The directory where the .mo file can be found.
  Save Snippet
if ( ! function_exists('custom_theme_background') ) {

// Register Theme Features
function custom_theme_background()  {

	// Add theme support for Post Formats
	add_theme_support( 'post-formats', array( 'gallery', 'image', 'video' ) );

	// Add theme support for Custom Background
	$background_args = array(
		'default-color'          => 'ffffff',
		'default-image'          => '',
		'default-repeat'         => 'no-repeat',
		'default-position-x'     => '',
		'wp-head-callback'       => '',
		'admin-head-callback'    => '',
		'admin-preview-callback' => '',
	add_theme_support( 'custom-background', $background_args );

	// Add theme support for Translation
	load_theme_textdomain( 'virtue', get_template_directory() . '/language' );
add_action( 'after_setup_theme', 'custom_theme_background' );