Support

Account

Home Forums General Issues Help for a beginner please !

Unread

Help for a beginner please !

  • Hi,
    I am not develloper and i dont get where to use this ??

    https://www.advancedcustomfields.com/resources/displaying-custom-field-values-in-your-theme/

    I dont get this doc at all!

    All values are saved as native post_meta (when saved to a post) and although you can use the native WP function get_post_meta(), it is better practice to use the relevant ACF function such as get_field(). Why? Because ACF will format the value depending on the field type and make development quicker and easier!

    To retrieve a field value as a variable, use the get_field() function. This is the most versatile function which will always return a value for any type of field.

    To display a field, use the the_field() in a similar fashion.

    Hereโ€™s a basic usage example, and please be sure to view the code example page for more.

    This …. ?? How to use it??

    <?php

    /**
    * Template Name: Home Page
    */

    get_header();

    ?>

    <div id=”primary”>
    <div id=”content” role=”main”>

    <?php while ( have_posts() ) : the_post(); ?>

    <h1><?php the_field(‘custom_title’); ?></h1>

    ” />

    <p><?php the_content(); ?></p>

    <?php endwhile; // end of the loop. ?>

    </div><!– #content –>
    </div><!– #primary –>

    <?php get_footer(); ?>

    I just want simply display fields + Prepend and Append. Ho to do that ??
    Can you please use a non-developper language to explain ??

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.