Support

Account

Home Forums General Issues Fields from another page

Solved

Fields from another page

  • I’m pulling data from another page into the footer and the code works on the staging site http://reach.wp.searlesgraphics.net/
    but not in the live environment.
    http://www.reachmarketing.com/ (look near the footer).

    This code is in the “footer.php” page.

    <?php $footer_logo_page = 2540;
       if(get_field('logo_list', $footer_logo_page)): 
         while(has_sub_field('logo_list', $footer_logo_page)):
           $image = wp_get_attachment_image_src(get_sub_field('logo'), 'full'); ?>
           <img src="<?php echo $image[0]; ?>" alt="" />
         <?php endwhile; 
     endif;?>

    I did change the page ID and double checked it and they are both using the same version of ACF. I can’t figure why this would happen. I know there is another plugin that will do this but this is working on the dev site and I’d rather get this working at this point.

  • Hi @Lucas

    Your code looks fine, so the issue must be that the ‘live’ page has a different post ID.

    Can you triple check that 2540 is the correct ID on the live site?
    Also, have you got data saved on that page on the live site? Did you import it? Did you manually enter it? Can you try to save it manually?

    Thanks
    E

  • I found what it was. In the field generator the Returned Value needed to be set to Image ID and I had it set to Image Object.

    Thanks for your help and getting back to me.
    The best plugin for WordPress by far. Couldn’t live without it.
    – Lucas

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

The topic ‘Fields from another page’ is closed to new replies.