私はこの単純なパイを使用しており、ファイルをホストにアップロードしました。1つのことを除いて、すべてが正常に機能しているようです。フィードを取得しているブログに画像が含まれていますが、シンプルパイを使用してフィードを表示すると、画像が表示されません。simplepie でブログを表示したときに画像を表示する方法はありますか?
わかりました申し訳ありませんが、私はこれが初めてです。ウェブサイトから直接コードを使用して、ブログを表示しようとしています。ここの一番下にコードを入れます。そうそう、私が読んでいるブログにある画像を表示しようとしているだけだと言ったように. それ以外はすべて素晴らしいです。
--- ヘッダー情報 ---
<?php
// Make sure SimplePie is included. You may need to change this to match the location of simplepie.inc.
require_once('simplepie.inc');
// We'll process this feed with all of the default options.
$feed = new SimplePie();
// Set the feed to process.
$feed->set_feed_url('http://wordpress.homickdesign.com/feed/');
// Run SimplePie.
$feed->init();
// This makes sure that the content is sent to the browser as text/html and the UTF-8 character set (since we didn't change it).
$feed->handle_content_type();
// Let's begin our XHTML webpage code. The DOCTYPE is supposed to be the very first thing, so we'll keep it on the same line as the closing-PHP tag.
?>
--- コード ---
<h2><a href="<?php echo $feed->get_permalink(); ?>"><?php echo $feed->get_description(); ?></a><br />
<span>Latest news from Robert Homick</span></h2>
<?php
$c=1;
foreach ($feed->get_items() as $item):
if($c <= 3){
?>
<p><a href="<?php echo $item->get_permalink(); ?>"><?php echo $item->get_title(); ?></a><br />
<?php echo $item->get_description(); ?><br />
<span>Posted on <?php echo $item->get_date('j F Y | g:i a'); ?></span><br />
<?php $c++;?>
<?php } endforeach; ?>