Home Forums Front-end Issues File field not linking to file


File field not linking to file

  • Hello. I am using the File field to upload a Google Earth file so a user can click it and it will open in Google Earth. This is the code I am using:

    <?php	if(get_field('google_earth_file')) {
    echo '<div class="bttn-google-earth"><a href="' . get_field('google_earth_file') . '" target="_blank">View in Google Earth</a></div>';

    When I click the link, I get “Array” at the end of my page URL. What am I doing wrong?

    You can see the site here: website

  • Hi @shawn00m

    You have selected ‘File Array’ as the return type, correct? This will return an array of data, not a url.

    Please change this to ‘File URL’, or read over the docs to see how you can use the array data.


  • Thank you. You are the best!

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

The topic ‘File field not linking to file’ is closed to new replies.