php echo not working correctly with multiple statements…
-
<?php if(get_post_meta($post->ID, "website", true)=='website');{ echo get_post_meta($post->ID, "website", true); }?> <?php if(get_post_meta($post->ID, "website", true)=='website'); { echo '<a href="' . get_post_meta($post->ID, "website", true) . '">TESTLINK</a> ?'; }?>
Above i have 2 lines of code. Im trying to only display a link for a website when there is a website defined by the user. For some reason the secodn statement shows “TESTLINK” on every post, when the first one only displays the text of the website when there is one, and nothing when there isnt (which is what i want). Why does the 2nd code echo every time no matter what? thanks ahead of time for the help
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘php echo not working correctly with multiple statements…’ is closed to new replies.