Title: wp_get_theme
Published: April 25, 2014
Last modified: February 24, 2026

---

# wp_get_theme( string $stylesheet, string $theme_root ): 󠀁[WP_Theme](https://developer.wordpress.org/reference/classes/wp_theme/)󠁿

## In this article

 * [Parameters](https://developer.wordpress.org/reference/functions/wp_get_theme/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/functions/wp_get_theme/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/wp_get_theme/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/wp_get_theme/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/wp_get_theme/?output_format=md#changelog)
 * [User Contributed Notes](https://developer.wordpress.org/reference/functions/wp_get_theme/?output_format=md#user-contributed-notes)

[ Back to top](https://developer.wordpress.org/reference/functions/wp_get_theme/?output_format=md#wp--skip-link--target)

Gets a [WP_Theme](https://developer.wordpress.org/reference/classes/wp_theme/) object
for a theme.

## 󠀁[Parameters](https://developer.wordpress.org/reference/functions/wp_get_theme/?output_format=md#parameters)󠁿

 `$stylesheet`stringoptional

Directory name for the theme. Defaults to active theme.

`$theme_root`stringoptional

Absolute path of the theme root to look in.
 If not specified, [get_raw_theme_root()](https://developer.wordpress.org/reference/functions/get_raw_theme_root/)
is used to calculate the theme root for the $stylesheet provided (or active theme).

## 󠀁[Return](https://developer.wordpress.org/reference/functions/wp_get_theme/?output_format=md#return)󠁿

 [WP_Theme](https://developer.wordpress.org/reference/classes/wp_theme/) Theme object.
Be sure to check the object’s exists() method if you need to confirm the theme’s
existence.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/wp_get_theme/?output_format=md#source)󠁿

    ```php
    function wp_get_theme( $stylesheet = '', $theme_root = '' ) {
    	global $wp_theme_directories;

    	if ( empty( $stylesheet ) ) {
    		$stylesheet = get_stylesheet();
    	}

    	if ( empty( $theme_root ) ) {
    		$theme_root = get_raw_theme_root( $stylesheet );
    		if ( false === $theme_root ) {
    			$theme_root = WP_CONTENT_DIR . '/themes';
    		} elseif ( ! in_array( $theme_root, (array) $wp_theme_directories, true ) ) {
    			$theme_root = WP_CONTENT_DIR . $theme_root;
    		}
    	}

    	return new WP_Theme( $stylesheet, $theme_root );
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/theme.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/theme.php#L117)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/theme.php#L117-L134)

## 󠀁[Related](https://developer.wordpress.org/reference/functions/wp_get_theme/?output_format=md#related)󠁿

| Uses | Description | 
| [get_raw_theme_root()](https://developer.wordpress.org/reference/functions/get_raw_theme_root/)`wp-includes/theme.php` |

Gets the raw theme root relative to the content directory with no filters applied.

  | 
| [get_stylesheet()](https://developer.wordpress.org/reference/functions/get_stylesheet/)`wp-includes/theme.php` |

Retrieves name of the current stylesheet.

  | 
| [WP_Theme::__construct()](https://developer.wordpress.org/reference/classes/wp_theme/__construct/)`wp-includes/class-wp-theme.php` |

Constructor for [WP_Theme](https://developer.wordpress.org/reference/classes/wp_theme/).

  |

| Used by | Description | 
| [WP_Debug_Data::get_wp_active_theme()](https://developer.wordpress.org/reference/classes/wp_debug_data/get_wp_active_theme/)`wp-admin/includes/class-wp-debug-data.php` |

Gets the WordPress active theme section of the debug data.

  | 
| [WP_Debug_Data::get_wp_parent_theme()](https://developer.wordpress.org/reference/classes/wp_debug_data/get_wp_parent_theme/)`wp-admin/includes/class-wp-debug-data.php` |

Gets the WordPress parent theme section of the debug data.

  | 
| [WP_Debug_Data::get_wp_themes_inactive()](https://developer.wordpress.org/reference/classes/wp_debug_data/get_wp_themes_inactive/)`wp-admin/includes/class-wp-debug-data.php` |

Gets the WordPress inactive themes section of the debug data.

  | 
| [WP_REST_Templates_Controller::get_wp_templates_author_text_field()](https://developer.wordpress.org/reference/classes/wp_rest_templates_controller/get_wp_templates_author_text_field/)`wp-includes/rest-api/endpoints/class-wp-rest-templates-controller.php` |

Returns a human readable text for the author of the template.

  | 
| [wp_get_theme_preview_path()](https://developer.wordpress.org/reference/functions/wp_get_theme_preview_path/)`wp-includes/theme-previews.php` |

Filters the blog option to return the path for the previewed theme.

  | 
| [_register_theme_block_patterns()](https://developer.wordpress.org/reference/functions/_register_theme_block_patterns/)`wp-includes/block-patterns.php` |

Register any patterns that the active theme may provide under its `./patterns/` directory.

  | 
| [WP_Theme_JSON_Resolver::get_style_variations()](https://developer.wordpress.org/reference/classes/wp_theme_json_resolver/get_style_variations/)`wp-includes/class-wp-theme-json-resolver.php` |

Returns the style variations defined by the theme.

  | 
| [WP_Theme_JSON_Resolver::get_user_data_from_wp_global_styles()](https://developer.wordpress.org/reference/classes/wp_theme_json_resolver/get_user_data_from_wp_global_styles/)`wp-includes/class-wp-theme-json-resolver.php` |

Returns the custom post type that contains the user’s origin config for the active theme or an empty array if none are found.

  | 
| [WP_Theme_JSON_Resolver::get_user_data()](https://developer.wordpress.org/reference/classes/wp_theme_json_resolver/get_user_data/)`wp-includes/class-wp-theme-json-resolver.php` |

Returns the user’s origin config.

  | 
| [WP_Theme_JSON_Resolver::get_user_global_styles_post_id()](https://developer.wordpress.org/reference/classes/wp_theme_json_resolver/get_user_global_styles_post_id/)`wp-includes/class-wp-theme-json-resolver.php` |

Returns the ID of the custom post type that stores user data.

  | 
| [wp_is_block_theme()](https://developer.wordpress.org/reference/functions/wp_is_block_theme/)`wp-includes/theme.php` |

Returns whether the active theme is a block-based theme or not.

  | 
| [get_block_theme_folders()](https://developer.wordpress.org/reference/functions/get_block_theme_folders/)`wp-includes/block-template-utils.php` |

For backward compatibility reasons, block themes might be using block-templates or block-template-parts, this function ensures we fallback to these folders properly.

  | 
| [WP_Theme_JSON_Resolver::get_theme_data()](https://developer.wordpress.org/reference/classes/wp_theme_json_resolver/get_theme_data/)`wp-includes/class-wp-theme-json-resolver.php` |

Returns the theme’s data.

  | 
| [WP_REST_Server::add_active_theme_link_to_index()](https://developer.wordpress.org/reference/classes/wp_rest_server/add_active_theme_link_to_index/)`wp-includes/rest-api/class-wp-rest-server.php` |

Adds a link to the active theme for users who have proper permissions.

  | 
| [WP_REST_Themes_Controller::get_item_permissions_check()](https://developer.wordpress.org/reference/classes/wp_rest_themes_controller/get_item_permissions_check/)`wp-includes/rest-api/endpoints/class-wp-rest-themes-controller.php` |

Checks if a given request has access to read the theme.

  | 
| [WP_REST_Themes_Controller::get_item()](https://developer.wordpress.org/reference/classes/wp_rest_themes_controller/get_item/)`wp-includes/rest-api/endpoints/class-wp-rest-themes-controller.php` |

Retrieves a single theme.

  | 
| [WP_REST_Themes_Controller::prepare_links()](https://developer.wordpress.org/reference/classes/wp_rest_themes_controller/prepare_links/)`wp-includes/rest-api/endpoints/class-wp-rest-themes-controller.php` |

Prepares links for the request.

  | 
| [validate_theme_requirements()](https://developer.wordpress.org/reference/functions/validate_theme_requirements/)`wp-includes/theme.php` |

Validates the theme requirements for WordPress version and PHP version.

  | 
| [WP_Recovery_Mode_Email_Service::get_debug()](https://developer.wordpress.org/reference/classes/wp_recovery_mode_email_service/get_debug/)`wp-includes/class-wp-recovery-mode-email-service.php` |

Return debug information in an easy to manipulate format.

  | 
| [WP_Recovery_Mode_Email_Service::get_cause()](https://developer.wordpress.org/reference/classes/wp_recovery_mode_email_service/get_cause/)`wp-includes/class-wp-recovery-mode-email-service.php` |

Gets the description indicating the possible cause for the error.

  | 
| [WP_Site_Health::get_test_theme_version()](https://developer.wordpress.org/reference/classes/wp_site_health/get_test_theme_version/)`wp-admin/includes/class-wp-site-health.php` |

Tests if themes are outdated, or unnecessary.

  | 
| [populate_network_meta()](https://developer.wordpress.org/reference/functions/populate_network_meta/)`wp-admin/includes/schema.php` |

Creates WordPress network meta and sets the default values.

  | 
| [WP_REST_Themes_Controller::get_items()](https://developer.wordpress.org/reference/classes/wp_rest_themes_controller/get_items/)`wp-includes/rest-api/endpoints/class-wp-rest-themes-controller.php` |

Retrieves a collection of themes.

  | 
| [WP_REST_Themes_Controller::prepare_item_for_response()](https://developer.wordpress.org/reference/classes/wp_rest_themes_controller/prepare_item_for_response/)`wp-includes/rest-api/endpoints/class-wp-rest-themes-controller.php` |

Prepares a single theme output for response.

  | 
| [WP_REST_Posts_Controller::check_template()](https://developer.wordpress.org/reference/classes/wp_rest_posts_controller/check_template/)`wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php` |

Checks whether the template is valid for the given post.

  | 
| [wp_edit_theme_plugin_file()](https://developer.wordpress.org/reference/functions/wp_edit_theme_plugin_file/)`wp-admin/includes/file.php` |

Attempts to edit a file for a theme or plugin.

  | 
| [WP_REST_Posts_Controller::handle_template()](https://developer.wordpress.org/reference/classes/wp_rest_posts_controller/handle_template/)`wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php` |

Sets the template for a post.

  | 
| [wp_ajax_install_theme()](https://developer.wordpress.org/reference/functions/wp_ajax_install_theme/)`wp-admin/includes/ajax-actions.php` |

Handles installing a theme via AJAX.

  | 
| [wp_ajax_update_theme()](https://developer.wordpress.org/reference/functions/wp_ajax_update_theme/)`wp-admin/includes/ajax-actions.php` |

Handles updating a theme via AJAX.

  | 
| [wp_ajax_delete_theme()](https://developer.wordpress.org/reference/functions/wp_ajax_delete_theme/)`wp-admin/includes/ajax-actions.php` |

Handles deleting a theme via AJAX.

  | 
| [WP_Theme::get_core_default_theme()](https://developer.wordpress.org/reference/classes/wp_theme/get_core_default_theme/)`wp-includes/class-wp-theme.php` |

Determines the latest WordPress default theme that is installed.

  | 
| [WP_Automatic_Updater::update()](https://developer.wordpress.org/reference/classes/wp_automatic_updater/update/)`wp-admin/includes/class-wp-automatic-updater.php` |

Updates an item, if appropriate.

  | 
| [Language_Pack_Upgrader::get_name_for_update()](https://developer.wordpress.org/reference/classes/language_pack_upgrader/get_name_for_update/)`wp-admin/includes/class-language-pack-upgrader.php` |

Gets the name of an item being updated.

  | 
| [Theme_Upgrader::theme_info()](https://developer.wordpress.org/reference/classes/theme_upgrader/theme_info/)`wp-admin/includes/class-theme-upgrader.php` |

Gets the [WP_Theme](https://developer.wordpress.org/reference/classes/wp_theme/) object for a theme.

  | 
| [wp_prepare_themes_for_js()](https://developer.wordpress.org/reference/functions/wp_prepare_themes_for_js/)`wp-admin/includes/theme.php` |

Prepares themes for JavaScript.

  | 
| [delete_theme()](https://developer.wordpress.org/reference/functions/delete_theme/)`wp-admin/includes/theme.php` |

Removes a theme.

  | 
| [get_page_templates()](https://developer.wordpress.org/reference/functions/get_page_templates/)`wp-admin/includes/theme.php` |

Gets the page templates available in this theme.

  | 
| [current_theme_info()](https://developer.wordpress.org/reference/functions/current_theme_info/)`wp-admin/includes/deprecated.php` |

Retrieves information on the current active theme.

  | 
| [WP_Theme_Install_List_Table::_get_theme_status()](https://developer.wordpress.org/reference/classes/wp_theme_install_list_table/_get_theme_status/)`wp-admin/includes/class-wp-theme-install-list-table.php` |

Checks to see if the theme is already installed.

  | 
| [populate_options()](https://developer.wordpress.org/reference/functions/populate_options/)`wp-admin/includes/schema.php` |

Create WordPress options and set the default values.

  | 
| [update_right_now_message()](https://developer.wordpress.org/reference/functions/update_right_now_message/)`wp-admin/includes/update.php` |

Displays WordPress version and active theme in the ‘At a Glance’ dashboard widget.

  | 
| [get_theme_updates()](https://developer.wordpress.org/reference/functions/get_theme_updates/)`wp-admin/includes/update.php` |

Retrieves themes with updates available.

  | 
| [wp_ajax_query_themes()](https://developer.wordpress.org/reference/functions/wp_ajax_query_themes/)`wp-admin/includes/ajax-actions.php` |

Handles getting themes from [themes_api()](https://developer.wordpress.org/reference/functions/themes_api/) via AJAX.

  | 
| [WP_Customize_Manager::theme()](https://developer.wordpress.org/reference/classes/wp_customize_manager/theme/)`wp-includes/class-wp-customize-manager.php` |

Gets the theme being customized.

  | 
| [WP_Customize_Manager::__construct()](https://developer.wordpress.org/reference/classes/wp_customize_manager/__construct/)`wp-includes/class-wp-customize-manager.php` |

Constructor.

  | 
| [check_theme_switched()](https://developer.wordpress.org/reference/functions/check_theme_switched/)`wp-includes/theme.php` |

Checks if a theme has been changed and runs ‘after_switch_theme’ hook on the next WP load.

  | 
| [remove_theme_mods()](https://developer.wordpress.org/reference/functions/remove_theme_mods/)`wp-includes/theme.php` |

Removes theme modifications option for the active theme.

  | 
| [switch_theme()](https://developer.wordpress.org/reference/functions/switch_theme/)`wp-includes/theme.php` |

Switches the theme.

  | 
| [validate_current_theme()](https://developer.wordpress.org/reference/functions/validate_current_theme/)`wp-includes/theme.php` |

Checks that the active theme has the required files.

  | 
| [get_theme_mods()](https://developer.wordpress.org/reference/functions/get_theme_mods/)`wp-includes/theme.php` |

Retrieves all theme modifications.

  | 
| [get_current_theme()](https://developer.wordpress.org/reference/functions/get_current_theme/)`wp-includes/deprecated.php` |

Retrieve current theme name.

  | 
| [wp_insert_post()](https://developer.wordpress.org/reference/functions/wp_insert_post/)`wp-includes/post.php` |

Inserts or update a post.

  |

[Show 47 more](https://developer.wordpress.org/reference/functions/wp_get_theme/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/functions/wp_get_theme/?output_format=md#)

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/wp_get_theme/?output_format=md#changelog)󠁿

| Version | Description | 
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |

## 󠀁[User Contributed Notes](https://developer.wordpress.org/reference/functions/wp_get_theme/?output_format=md#user-contributed-notes)󠁿

 1.   [Skip to note 11 content](https://developer.wordpress.org/reference/functions/wp_get_theme/?output_format=md#comment-content-674)
 2.    [Codex](https://profiles.wordpress.org/codex/)  [  11 years ago  ](https://developer.wordpress.org/reference/functions/wp_get_theme/#comment-674)
 3.  [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_get_theme%2F%23comment-674)
     Vote results for this note: 5[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_get_theme%2F%23comment-674)
 4.  **Echo the name of an installed theme**
 5.      ```php
         <?php
         $my_theme = wp_get_theme( 'twentytwelve' );
         if ( $my_theme->exists() )
         	echo esc_html( $my_theme );
         ?>
         ```
     
 6.   [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_get_theme%2F%3Freplytocom%3D674%23feedback-editor-674)
 7.   [Skip to note 12 content](https://developer.wordpress.org/reference/functions/wp_get_theme/?output_format=md#comment-content-2439)
 8.    [tazotodua](https://profiles.wordpress.org/tazotodua/)  [  8 years ago  ](https://developer.wordpress.org/reference/functions/wp_get_theme/#comment-2439)
 9.  [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_get_theme%2F%23comment-2439)
     Vote results for this note: 5[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_get_theme%2F%23comment-2439)
 10. Result:
 11.     ```php
         object(WP_Theme)[916]
           public 'update' => boolean false
           private 'theme_root' => string 'home/path/wp-content/themes' (length=77)
           private 'headers' => 
             array (size=11)
               'Name' => string 'mytheme' (length=7)
               'ThemeURI' => string 'http://example.com/' (length=22)
               'Description' => string 'Description' (length=11)
               'Author' => string 'Something Here' (length=14)
               'AuthorURI' => string 'http://example.com/' (length=22)
               'Version' => string '1.0.0' (length=5)
               'Template' => string '' (length=0)
               'Status' => string '' (length=0)
               'Tags' => string 'custom-background, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready' (length=98)
               'TextDomain' => string 'mytheme' (length=7)
               'DomainPath' => string '' (length=0)
           private 'headers_sanitized' => null
           private 'name_translated' => null
           private 'errors' => null
           private 'stylesheet' => string 'mytheme' (length=7)
           private 'template' => string 'mytheme' (length=7)
           private 'parent' => null
           private 'theme_root_uri' => null
           private 'textdomain_loaded' => null
           private 'cache_hash' => string 'ca9dd01f01f2a5cb4616a776eff52690' (length=32)
         ```
     
 12.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_get_theme%2F%3Freplytocom%3D2439%23feedback-editor-2439)
 13.  [Skip to note 13 content](https://developer.wordpress.org/reference/functions/wp_get_theme/?output_format=md#comment-content-677)
 14.   [Codex](https://profiles.wordpress.org/codex/)  [  11 years ago  ](https://developer.wordpress.org/reference/functions/wp_get_theme/#comment-677)
 15. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_get_theme%2F%23comment-677)
     Vote results for this note: 2[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_get_theme%2F%23comment-677)
 16. **Get other data: Text domain & theme URI**
 17.     ```php
         <?php
         $my_theme = wp_get_theme();
         echo esc_html( $my_theme->get( 'TextDomain' ) );
         echo esc_html( $my_theme->get( 'ThemeURI' ) );
         ?>
         ```
     
 18.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_get_theme%2F%3Freplytocom%3D677%23feedback-editor-677)
 19.  [Skip to note 14 content](https://developer.wordpress.org/reference/functions/wp_get_theme/?output_format=md#comment-content-4749)
 20.   [vebbmaster](https://profiles.wordpress.org/vebbmaster/)  [  5 years ago  ](https://developer.wordpress.org/reference/functions/wp_get_theme/#comment-4749)
 21. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_get_theme%2F%23comment-4749)
     Vote results for this note: 0[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_get_theme%2F%23comment-4749)
 22. Switch a specific theme on all sites in a multisite installation
 23.     ```php
         <?php
         function wpdocs_switch_all_multisite_themes() {
             foreach ( get_sites() as $site ) {
                 switch_to_blog( $site->blog_id );
         	$blog_theme = wp_get_theme();
         	if ( 'twentyeleven' === $blog_theme ) {
                     switch_theme( 'twentytwenty' );
                     restore_current_blog();
         	}
             }
         }
     
         wpdocs_switch_all_multisite_themes();
         ?>
         ```
     
 24.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_get_theme%2F%3Freplytocom%3D4749%23feedback-editor-4749)
 25.  [Skip to note 15 content](https://developer.wordpress.org/reference/functions/wp_get_theme/?output_format=md#comment-content-5921)
 26.   [Alberuni Azad.](https://profiles.wordpress.org/alberuni-azad/)  [  4 years ago  ](https://developer.wordpress.org/reference/functions/wp_get_theme/#comment-5921)
 27. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_get_theme%2F%23comment-5921)
     Vote results for this note: 0[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_get_theme%2F%23comment-5921)
 28. Get the directory name of the current theme regardless of the child theme.
 29.     ```php
         function wpdocs_get_current_theme_directory(){
             $current_theme_dir  = '';
             $current_theme      = wp_get_theme();
             if( $current_theme->exists() && $current_theme->parent() ){
                 $parent_theme = $current_theme->parent();
     
                 if( $parent_theme->exists() ){
                     $current_theme_dir = $parent_theme->get_stylesheet();
                 }
             } elseif( $current_theme->exists() ) {
                 $current_theme_dir = $current_theme->get_stylesheet();
             }
     
             return $current_theme_dir;
         }
     
         echo wpdocs_get_current_theme_directory();
         ```
     
 30.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_get_theme%2F%3Freplytocom%3D5921%23feedback-editor-5921)
 31.  [Skip to note 16 content](https://developer.wordpress.org/reference/functions/wp_get_theme/?output_format=md#comment-content-6885)
 32.   [Deepak Rajpal](https://profiles.wordpress.org/deepakrajpal/)  [  2 years ago  ](https://developer.wordpress.org/reference/functions/wp_get_theme/#comment-6885)
 33. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_get_theme%2F%23comment-6885)
     Vote results for this note: 0[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_get_theme%2F%23comment-6885)
 34. Code to Display current or any installed theme version:
 35. **Display current theme version:**
 36.     ```php
         $theme_info = wp_get_theme();
         echo $theme_info->get( 'Version' );
         ```
     
 37. **Display any of installed theme version using directory name:**
 38.     ```php
         $theme_info = wp_get_theme( 'twentytwentyfour' );
         echo $theme_info->get( 'Version' );
         ```
     
 39.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_get_theme%2F%3Freplytocom%3D6885%23feedback-editor-6885)
 40.  [Skip to note 17 content](https://developer.wordpress.org/reference/functions/wp_get_theme/?output_format=md#comment-content-7249)
 41.   [Ben Sibley](https://profiles.wordpress.org/bensibley/)  [  1 year ago  ](https://developer.wordpress.org/reference/functions/wp_get_theme/#comment-7249)
 42. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_get_theme%2F%23comment-7249)
     Vote results for this note: 0[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_get_theme%2F%23comment-7249)
 43. As of WP 6.7, make sure not to call this function any earlier than the “init” 
     hook, or it will trigger the following error:
 44. **PHP Notice: Function _load_textdomain_just_in_time was called ****incorrectly**
 45.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_get_theme%2F%3Freplytocom%3D7249%23feedback-editor-7249)
 46.  [Skip to note 18 content](https://developer.wordpress.org/reference/functions/wp_get_theme/?output_format=md#comment-content-676)
 47.   [Codex](https://profiles.wordpress.org/codex/)  [  11 years ago  ](https://developer.wordpress.org/reference/functions/wp_get_theme/#comment-676)
 48. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_get_theme%2F%23comment-676)
     Vote results for this note: -2[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_get_theme%2F%23comment-676)
 49. **Display the current theme author URI**
 50.     ```php
         $my_theme = wp_get_theme();
         echo esc_html( $my_theme->get( 'AuthorURI' ) );
         ```
     
 51.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_get_theme%2F%3Freplytocom%3D676%23feedback-editor-676)
 52.  [Skip to note 19 content](https://developer.wordpress.org/reference/functions/wp_get_theme/?output_format=md#comment-content-675)
 53.   [Codex](https://profiles.wordpress.org/codex/)  [  11 years ago  ](https://developer.wordpress.org/reference/functions/wp_get_theme/#comment-675)
 54. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_get_theme%2F%23comment-675)
     Vote results for this note: -4[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_get_theme%2F%23comment-675)
 55. **Display the current theme’s version**
 56.     ```php
         $my_theme = wp_get_theme();
         printf( "%1$s is version %2$s",
         	$my_theme->get( 'Name' ),
         	$my_theme->get( 'Version' )
         );
         ```
     
 57.  * This doesn’t work. You need to $my_theme = [wp_get_theme()](https://developer.wordpress.org/reference/functions/wp_get_theme/);
        echo “; print_r($my_theme); echo “; To output the name and version, you need
        to do: echo $my_theme[‘Name’]; echo $my_theme[‘Version’];
      * [ashkanahmadi](https://profiles.wordpress.org/ashkanahmadi/) [6 years ago](https://developer.wordpress.org/reference/functions/wp_get_theme/#comment-4194)
 58.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_get_theme%2F%3Freplytocom%3D675%23feedback-editor-675)
 59.  [Skip to note 20 content](https://developer.wordpress.org/reference/functions/wp_get_theme/?output_format=md#comment-content-673)
 60.   [Codex](https://profiles.wordpress.org/codex/)  [  11 years ago  ](https://developer.wordpress.org/reference/functions/wp_get_theme/#comment-673)
 61. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_get_theme%2F%23comment-673)
     Vote results for this note: -8[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_get_theme%2F%23comment-673)
 62. **Echo the name of the current active theme**
 63.     ```php
         <?php
         echo wp_get_theme();
         ?>
         ```
     
 64.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_get_theme%2F%3Freplytocom%3D673%23feedback-editor-673)

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_get_theme%2F)
before being able to contribute a note or feedback.