I create a group field for "contact info" and define to edit it only in Homepage. enter image description here

And it works on Homepage. But if I go to another page of the website, the fields just disappear enter image description here

My code for contact info in header.php is:


        <section class="container-top">
            <div class="wrapper">
                    <?php the_field( 'telefone_header' ); ?>            
                <a href="mailto:<?php the_field( 'email_header' ); ?>">
                    <?php the_field( 'email_header' ); ?>

                <?php get_search_form(); ?>
        <section class="container-header">
            <div class="wrapper">
                    <a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="Limpen">
                        <img src="<?php bloginfo( 'template_directory' ); ?>/images/limpen.jpg" alt="Limpen">
                <?php wp_nav_menu ( array (
                        'container' => false,
                        'items_wrap' => '<ul>%3$s</ul>',
                        'walker' => new My_Walker_Nav_Menu()
                ); ?>
                    <div class="ico-menu"></div>


And for the footer.php is:

<div class="links">
                        Fale Conosco
                    <div class="info">
                            <?php the_field( 'titulo_empresa' ); ?>
                        <a href="mailto:<?php the_field( 'email_empresa' ); ?>"><?php the_field( 'email_empresa' ); ?></a>
                        <span><?php the_field( 'telefones_empresa' ); ?></span>
                            <?php the_field( 'endereco_empresa' ); ?>
  • proper place to ask it is ACF support Oct 13, 2016 at 9:52
  • asked there too
    – Luan
    Oct 13, 2016 at 9:53

1 Answer 1


You need to add the ID of the page as the second argument.

E.G If your home page has a page ID of 1, you need to do:

the_field('field_name', 1);

See here for more information on the_field.


  • Thank you Steve! I updated the line of code with the page ID in both (header.php and footer.php) and now it works on all pages.
    – Luan
    Oct 13, 2016 at 9:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.