Viewing 5 replies - 1 through 5 (of 5 total)
  • I think this answers it pretty much: https://wordpress.stackexchange.com/a/41300

    I would however advice against if for most cases. Instead of uploading it to your own wordpress server, why not just save the airtable cdn’s img url to a metafield of your post/page/cpt, and fetch that url on the front end instead of the featured image. Or just fetch the img via Airtable’s AirQuery function (even better I’d say).

    That saves you server space and prevents duplicate content (which could mean hassle if you want to keep them in sync) over both airtable and your own server.

    • This reply was modified 4 years, 11 months ago by tomzorz.
    • This reply was modified 4 years, 11 months ago by tomzorz.
    Thread Starter mq3v07

    (@mq3v07)

    The challenge is that I have 9000 pages that are populated by airpress fields.

    How would I do this at scale?

    There could be a number of ways probably. I’d def go with popping an AirpressQuery somewhere in your theme’s page template.

    Something like this:

    if (isset($_GET['artnr'])) {
    	$query = new AirpressQuery();
    	$query->setConfig("Test config");
    	$query->table("Table X");
    	$query->addFilter("{Article nr}='".$_GET['artnr']."'");
    
    	$result = new AirpressCollection($query);
    
    	foreach ($result as $key => $prod) {
    		echo "<div>";
    		echo $prod['Art nr'] . $prod['Product Title'] . '<img src="' . $prod['Product Pictures']['0']['thumbnails']['large']['url'] . '">';
    		echo "</div>";
    	}
    }

    Of course you do need an identifier to reference to the right Airtable record. In this example I’m getting it from a url parameter, but that’s not a common approach. But from that identifier I’m just fetching the right record and then its thumbnail image.

    Of course I’m not sure how your Airtable or WordPress pages are set up, but something like this should work well.

    • This reply was modified 4 years, 11 months ago by tomzorz.
    Thread Starter mq3v07

    (@mq3v07)

    Do you freelance? I’m not that versed in PHP so 15-20 mins of your time to make this work would be great.

    My airtable set up is super simple and the post header is what sets the airpress query as I’m only using fields

    Yes I do actually. I’d suggest to send me a mail at hello (at) tomkeysers.be with your info and let’s see if we can work it out.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Featured Images’ is closed to new replies.