Support » Plugin: Airpress » basic php not working

  • I’m new to Airpress and Airtable but it looks promising. I have successfully set up a connection and using Virtual Fields in the body copy of a post using shortcodes.

    [apr field=”Adult”]
    [apr field=”Cost Kids”]

    However, I use the PHP Code Widget to build sidebars and was having trouble writing php code that works with Airpress. Airpress has a basic script on the site which I have modified with my column names. The only thing that displays is a colon. What else do I need to do to make the php work?:

    Basic script that is on Airpress Plugin Page:

    <?php
    $e = $post->AirpressCollection[0];
    echo $e[“Name”].”: “.$e[“Start Date”].”<br>”;
    ?>

    With modification:

    <?php
    $e = $post->AirpressCollection[0];
    echo $e[“Adult”].”: “.$e[“Cost Kids”].”<br>”;
    ?>

Viewing 1 replies (of 1 total)
  • Plugin Author chetmac

    (@chetmac)

    Can you send me a link to where I can learn more about this PHP Code Widget? I’m assuming it’s a plugin?

    In the meantime, try turning on debugging (https://wordpress.org/support/article/debugging-in-wordpress/) and checking logs.

    My first guess is that it may be a “race condition” where the PHP Code Widget is processing the code before (or in a different scope) than Airpress.

Viewing 1 replies (of 1 total)
  • The topic ‘basic php not working’ is closed to new replies.