Conditional function – more than one variable
-
Have a function that works but i use it twice – instead of once.
This seems wasteful as the conditions are mutually exclusive.
So i should be able to use something like OR or in_array but i just dont know how.
Any help would be great and appreciated!!
So this is how it is at the moment.
In English – if the person is a Senator or Congressman then go here
<?php if (strpos(get_post_meta( get_the_ID(), 'app_assignment', true ),'Senator') !== false) { ?> <a href="my-site/politicians/?>"<?php _e( ' Politicians', APP_PR ); ?></a> <?php } ?> <?php if (strpos(get_post_meta( get_the_ID(), 'app_assignment', true ),'Congressman') !== false) { ?> <a href="my-site/politicians/?>"<?php _e( ' Politicians', APP_PR ); ?></a> <?php } ?>I should be able to put this into one statement but … just need help! Please!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Conditional function – more than one variable’ is closed to new replies.