Conditional text
-
Hello everyone,
How can I make just plain text conditional and depending on custom field value?
Let´s say I have custom field with the name “Do you like blue or black?”, possible values being, well “blue” and “black”. If the value is blue, there´s another custom field with the name: “What kind of blue” with values like “navy”, “deep”, etc.
Now, those fields show on posts like this:
- Blue or black: <?php echo c2c_get_custom(‘blueorblack’); ?>
- What kind of blue: <?php echo c2c_get_custom(‘whatblue’); ?>
How can I make it so that when the value for first question is “black”, the “what kind of blue:” text is not shown?
As you can see I use get custom fields plugin, but it is not necessary if the solution should to be done without it.
Hopefully I made sense with this, after all I presume this is nothing too complicated, but just can´t get my head around it.
The topic ‘Conditional text’ is closed to new replies.