• Resolved dimitris71

    (@dimitris71)


    Hi there, I have been created two custom fields with acf and I want to display them in every post in the front end in two diferrent places (after post title the first and after excerpt the second) with labels explaining each value. Also the same when posts displaying in blog archive posts. I added the code below (only for the first custom field) in the file content.php under the post title section. I am not familiar with coding and I need your help please!

                $custom_field_value = get_field( 'syggrafeas' );
                if ( $custom_field_value ) {
                    echo '<div class="custom-field-label">Συγγραφ?α?:</div>';
                    echo '<div class="custom-field-value">' . esc_html( $custom_field_value ) . '</div>';
                }
                ?>

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author WPLake

    (@wplakeorg)

    Hi @dimitris71

    You may have confused ACF Views with the Advanced Custom Fields (ACF) plugin.
    Our plugin ACF Views, allows you to assign fields in a View and then display the output using a shortcode. Where the markup is generated automatically.

    Thread Starter dimitris71

    (@dimitris71)

    Thanks for the clarification, but is there a way to show custom fileds on every post article, in the frontend, without having to put a shortcode in each post?

    Plugin Author WPLake

    (@wplakeorg)

    Hi @dimitris71

    Yes there is, if you add the Views shortcode into the Post template, then it’ll display for every post.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘I can;t display custom fields in the frontent’ is closed to new replies.