Hi all, complete PHP rookie here, so just looking for help on an existing WordPress site with a form compiling certain pages.
There is a form within a plugin on our site asking for employee testimonials… if that area is NOT filled out, we need the header above it to also not display. What would be the IF statement we would need to add here to hide that header?
<?php echo “<hr class=’headerhighlight’>”; ?> <?php echo “<h5 class=’title’>Employee Testimonials</h5>”; ?> <?php $value = get_post_meta(get_the_ID(), ’emptestimonials’, true); echo “$value”; ?>
Thanks for tolerating my newbie ass!
[ad_2]
You know, for a newbie, you are almost a code away. Please see below.
<?php echo “<hr class=’headerhighlight’>”; ?>
<?php
$value = get_post_meta(get_the_ID(), ’emptestimonials’, true);
if (!empty($value)) {
echo “<h5 class=’title’>Employee Testimonials</h5>”;
echo “$value”;
}
?>