Does someone know how to write the next line in wordpress PHP, because i'm not that great with PHP.
If_theme_mode has content echo { my content } else { other content };
thnx
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.
Sign up to join this communityDoes someone know how to write the next line in wordpress PHP, because i'm not that great with PHP.
If_theme_mode has content echo { my content } else { other content };
thnx
try this code:
if( get_theme_mod('your_setting_name') ){
//your code
}else{
//your code
}
Note: get_theme_mod() return false if no value exist for your setting
You can check for a theme mod, echo it if it exists, or apply a default if not, all with one line:
echo get_theme_mod( 'example', 'Some default' );