Support

Account

Home Forums Front-end Issues Display the field's name before the content on front end

Helping

Display the field's name before the content on front end

  • Hello all !

    I would like to display the field name on the front end side of a website, with it being not editable unlike the content of the field.

    Is this possible?

    Here is the section of the page template, with the titles being hardcoded:

    <h2>field_1 title</h2>
    <?php the_field('field_1'); ?>
    <h2>field_2 title</h2>
    <?php the_field('field_2'); ?>

    Thanks a lot !

    Clément.

  • Hi @c-champeau

    It is possible to get any of the field settings and display them on the frontend. Please take a lookat the get_feld_object() function that is described on this page: https://www.advancedcustomfields.com/resources/get_field_object/

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

The topic ‘Display the field's name before the content on front end’ is closed to new replies.