Noob trying to write wordpress shortcode, help appreciated
:confused:Hello - hope this is the right place to come.
I'm trying to write a shortcode for Wordpress that compares two values, and if they match, generates content. If they don't match, no content is shown.
I'm a proper noob at this, and have tried a few ways, but no success.
The following generates the content, but it's not working.
[compare val1="no" val2="yes"]this is my content[/compare] outputs the conten, whereas only [compare val1="yes" val2="yes"]this is my content[/compare] should output the content. What am I doing wrong? Do I need an else clause (which I'm not sure how to add).
'val1' =>'', 'val2' => '')
if($val1 == $val2)
$content = '';
Any help much appreciated… I've got to learn!