Support

Account

Home Forums General Issues Fields from another page

Solved

Fields from another page

    • Lucas

    • August 29, 2013 at 11:42 pm

    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.

    • Elliot

    • August 30, 2013 at 2:55 pm

    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

    • Lucas

    • August 30, 2013 at 11:55 pm

    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)

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.