WORDPRESS
[WordPress] 指定Image URL為Featured Image

featured image

最近裝了WordPress Related Posts Plugin才發現自己沒Enable Post Thumbnails,Enable後想為每個Post Set Featured Image(=Thumbnail),但發現Featured Image都是要上傳的,因我用的Hosting是heroku,就這樣上傳圖檔不能被保留的(有解決方法的,但未搞XD),所以就改為指定URL為Featured Image啦。

做法

1. 在UI加textbox輸入URL
2. 將輸入的URL儲存在Custom Post Meta
3. 將輸入的URL Display

加以下的Code到functions.php

參考

Is it possible set a featured image with external image URL
http://wordpress.stackexchange.com/questions/158491/is-it-possible-set-a-featured-image-with-external-image-url

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">