mardi 30 août 2016

Assigning part of an if statement to a variable

Is it possible to assign

get_theme_mod('dds) !=='false';

to a variable and include it in an if statement instead of typing the whole thing?

This is the if statement I am dealing with:

$DDS = get_theme_mod('dds')!=='false';

if(is_category() && $DDS :
    //output some css style
endif;

I get an error: Parse error: syntax error, unexpected ':'

Aucun commentaire:

Enregistrer un commentaire