【发布时间】:2014-04-01 15:38:34
【问题描述】:
我正在尝试找到使用 PHP 获取指定元素/类中第一张图片的 URL 的最简单方法,以插入 Open Graph og:image 和 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; ?>"/>
我还想知道我是否可以让它通过回显在相对 URL 前面获取域,而不是在元标记中的回显前面硬编码它。
【问题讨论】:
标签: php html facebook-opengraph