get_theme_mod() WP 1.0
Retrieve theme modification value for the current theme.
If the modification name does not exist, then the $default will be passed through sprintf() PHP function with the template directory URI as the first string and the stylesheet directory URI as the second string.
Works based on: get_theme_mods()
Basis of: get_custom_logo(), get_header_image(), get_header_textcolor(), get_header_video_url(), get_nav_menu_locations(), has_custom_logo()
1 time = 0.000035s = very fast | 50000 times = 0.58s = very fast | PHP 7.0.5, WP 4.5
Hooks from the function
Return
Mixed. Theme modification value.
Usage
get_theme_mod( $name, $default );
- $name(string) (required)
- Theme modification name.
- $default(string/false)
- Theme modification default value.
Default: false
Changelog
Since 2.1.0 | Introduced. |
Code of get_theme_mod() get theme mod WP 5.6
Related Functions
From tag: Theme Modification API (theme mods options settings)
More from category: Other Theme Functions
- add_theme_support()
- bloginfo()
- body_class()
- current_theme_supports()
- get_custom_header_markup()
- get_custom_logo()
- get_header_image()
- get_header_image_tag()
- get_header_textcolor()
- get_header_video_url()
- get_page_templates()
- get_post_class()
- get_query_template()
- get_stylesheet()
- get_template()
- get_theme_root()
- has_custom_logo()
- has_header_image()
- has_header_video()
- is_child_theme()
- is_header_video_active()
- is_multi_author()
- post_class()
- register_nav_menu()
- register_nav_menus()
- register_theme_directory()
- remove_theme_support()
- search_theme_directories()
- single_month_title()
- the_custom_header_markup()
- the_custom_logo()
- the_header_video_url()