dongni8124 2014-08-05 19:59
浏览 149
已采纳

WordPress获取YouTube图像缩略图

I'm trying to let users post a video on one our sites with text beneath it. Is there a way display the YouTube thumbnail image as a user's post thumbnail.

Example:

I post a YouTube video on the site: IMAGE LINK

Using HTML/PHP I pull in the posts on to my website using the below code:

<?php
    $posts = get_posts('cat=3');
    foreach ($posts as $post) : setup_postdata( $post );
?>
        <?php the_date(); echo "<br />"; ?>
        <?php the_title(); ?>
    <?php endforeach; ?>

I want to load the image/video and then the title of the post. Not the date or any other content. How can this be done?

Then how can I make that thumbnail a link to go to the actual post?

  • 写回答

2条回答 默认 最新

  • dongtang1966 2014-08-05 20:13
    关注

    You could grab the video id by using a custom field and place it inside the Video Thumbnail URL to get the video thumbnail.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥60 请查询全国几个煤炭大省近十年的煤炭铁路及公路的货物周转量
  • ¥15 请帮我看看我这道c语言题到底漏了哪种情况吧!
  • ¥66 如何制作支付宝扫码跳转到发红包界面
  • ¥15 pnpm 下载element-plus
  • ¥15 解决编写PyDracula时遇到的问题
  • ¥15 有没有人能解决下这个问题吗,本人不会编程
  • ¥15 plotBAPC画图出错
  • ¥30 关于#opencv#的问题:使用大疆无人机拍摄水稻田间图像,拼接成tif图片,用什么方法可以识别并框选出水稻作物行
  • ¥15 Python卡尔曼滤波融合
  • ¥20 iOS绕地区网络检测