Simple php IF help for a newbie – WordPress page populating by a Plugin

[ad_1]

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]
1 Comment
  1. 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”;
    }
    ?>

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer