I'm trying to find the simplest way using PHP to get the URL of the first image inside a specified element/class, to insert into Open Graph og:image
and Twitter twitter:image
<figure class="pictures">
<img src="/pictures/1.jpg"> <!-- it would be this here -->
<img src="/pictures/2.jpg">
<img src="/pictures/3.jpg">
</figure>
<meta property="og:image" content="<?php echo $og_image; ?>"/>
Also wondering if I can have it get the domain in front of the relative URL through the echo, instead of hardcoding it in front of the echo in the meta tags.