• wordpress3.1にfeedwordpressプラグインを入れて、様々な外部のブログのRSSを取得して表示させています。

    このプラグインをそのまま使うとタイトルと本文、カテゴリー、日時などが表示されますが、これにその記事の「ブログ名」を表示させるにはどうしたら良いのでしょうか?

    よろしくお願いします。

1件の返信を表示中 - 1 - 1件目 (全1件中)
  • トピック投稿者 harazaki

    (@harazaki)

    自己解決しました。

    feedwordpressプラグインは使っている方が少ないのか回答がなかなかつかないので(笑)、あとから同じような疑問を持つ方のために解決策を記しておきます。

    とりあえず、こんな感じでいけました。
    僕も素人なので、おかしな点があればご指摘頂けると幸いです。

    ブログ名:<?php the_syndication_source(); ?>
    ブログのURLリンク: <?php the_syndication_source_link(); ?>
    ブログのURL: <?php print $link->homepage(); ?>
    ブログ記事の作者: <?php the_author(); ?>

    以下のように使うようです。

    <?php $link = get_syndication_feed_object();?>
    <a href="<?php print htmlspecialchars($url); ?>"><?php the_title(); ?></a> is a post from:  <a href="<?php the_syndication_source_link(); ?>"><?php the_syndication_source(); ?></a> // <a href="<?php the_syndication_source_link(); ?>"></a> by <?php the_author(); ?>.
    <?php endif; ?>

    参考:http://feedwordpress.radgeek.com/wiki/templates

1件の返信を表示中 - 1 - 1件目 (全1件中)
  • トピック「FeedWordPressプラグインでブログタイトルを表示させたい」には新たに返信することはできません。