I have a function where I want to display something if the value equals A, C or D.
The problem is if the value is set at B or E, the function is display data in the A.C.D. set in addition to the B or E set.
What am I doing wrong?
$linkp = opensky_featured_image_position();
if ( $linkp == 'featuredimg-1' || 'featuredimg-3' || 'featuredimg-4' ) {
echo '<h1>F - '. opensky_featured_image_position() .'</h1>';
}
if ( $linkp == 'featuredimg-2' ) {
echo '<h1>L - '. opensky_featured_image_position() .'</h1>';
}
if ( $linkp == 'featuredimg-5' ) {
echo '<h1>N - '. opensky_featured_image_position() .'</h1>';
}
Should be
If all the values of $linkkp are defined you could do something like this