Support

Account

Home Forums ACF PRO Uncaught Error: Call to undefined function the_field()

Solving

Uncaught Error: Call to undefined function the_field()

    • mrtoad

    • March 20, 2020 at 6:40 am

    Hi everyone

    I am using ACF Pro with Gutenberg and have spent the better part of a day trying to get this to work.

    My current issue is:

    Uncaught Error: Call to undefined function the_field()

    Which appears to be flagged right at the start on this line:

    <div class=”featured-listing-content hang-left <?php the_field (‘listing_background_colour’ );?>”>

    You can see the full php code here:

    http://sandbox.onlinephpfunctions.com/code/576b194a2fd93b0e21a8f52af29b6fd11b0bf7fb

    I can’t work out what it is I am doing wrong??

    I’m very new to ACF and PHP so this is quite a complex setup for me – any help would be much appreciated

    • mrtoad

    • March 20, 2020 at 7:37 am

    Apologies the undefined function is not the error – it is a critical error that takes the site down

    • mrtoad

    • March 20, 2020 at 7:50 am

    Solved – I had missed a closing bracket AND entered a value for the last if/else statement

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.