Home Forums Front-end Issues Displaying a title when a field is completed


Displaying a title when a field is completed

  • Hi everybody,

    First, thanks for this amazing plugin.
    Repeater add-on is dope !

    I would like to know if is it possible to display a title on my page,
    if and only if the field is completed.

    For example, we can imagine a ‘Credits’ field,
    which may be empty as optional,
    but when we set a value to it,
    a title will be displayed on the page.

    something like this
    <h3>The Value</h3>

    Cheers from France !

  • I just tried with this

    	echo '<h3>Année</h3>' . get_field('proj_annee');

    But the result of get_filed(‘proj_annee’) is ‘Array’

  • ok i got it

    <?php if( get_field('proj_annee') ): ?>
    	<h3>Année</h3> <?php the_field('proj_annee'); ?>
    <?php endif; ?>

    The answer was here :

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘Displaying a title when a field is completed’ is closed to new replies.