get_theme_mod [ WordPress Function ]
| Parameters: |
|
| Uses: | |
| Returns: |
|
| Defined at: |
|
Retrieve theme modification value for the current theme.
If the modification name does not exist, then the $default will be passed through {@link http://php.net/sprintf sprintf()} PHP function with the first string the template directory URI and the second string the stylesheet directory URI.
Source
<?php
function get_theme_mod( $name, $default = false ) {
$mods = get_theme_mods();
if ( isset( $mods[ $name ] ) )
return apply_filters( "theme_mod_$name", $mods[ $name ] );
if ( is_string( $default ) )
$default = sprintf( $default, get_template_directory_uri(), get_stylesheet_directory_uri() );
return apply_filters( "theme_mod_$name", $default );
}
?>
Examples [ wp-snippets.com ]
Top Google zoekresultaten
- Function Reference/get theme mod « WordPress Codex
Description. Retrieve theme modification value for the current theme. If the modification name does not exist, then the $default will be passed through sprintf () ...
codex.wordpress.org - WordPress › Support » *get_theme_mod* seems not returning any ...
[resolved] *get_theme_mod* seems not returning any value after upgrading tp ... a serious problem when upgrading to WP 3.1, it seems that *get_theme_mod* ...
wordpress.org - get_theme_mod | A HitchHackers guide through WordPress
Feb 12, 2011 ... function get_theme_mod( $name, $default = false ) { $mods = get_theme_mods() ; if ( isset( $mods[ $name ] ) ) return apply_filters( ...
hitchhackerguide.com - How to Set a Default Custom Background in WordPress 3.0 - c.bavota
Nov 30, 2010 ... background-repeat: ' . get_theme_mod('background_repeat', ... background- position: top ' . get_theme_mod('background_position_x', 'left') .
bavotasan.com
Gebruikersdiscussies [ wordpress.org ]
- Julian Magnone on "*get_theme_mod* seems not returning any value after upgrading tp WordPress 3.1"
- webgrafia on "*get_theme_mod* seems not returning any value after upgrading tp WordPress 3.1"
- Alonce Vincent on "*get_theme_mod* seems not returning any value after upgrading tp WordPress 3.1"
- hznmoodi on "*get_theme_mod* seems not returning any value after upgrading tp WordPress 3.1"
- turkeybucket on "*get_theme_mod* seems not returning any value after upgrading tp WordPress 3.1"
- hznmoodi on "*get_theme_mod* seems not returning any value after upgrading tp WordPress 3.1"
- turkeybucket on "*get_theme_mod* seems not returning any value after upgrading tp WordPress 3.1"
- rguan on "*get_theme_mod* seems not returning any value after upgrading tp WordPress 3.1"
- GWorld on "*get_theme_mod* seems not returning any value after upgrading tp WordPress 3.1"
- turkeybucket on "*get_theme_mod* seems not returning any value after upgrading tp WordPress 3.1"