Popularity Contest*人気投稿記事を表示する
自分が投稿した記事がどれくらい人に見られているかがわかるプラグインです。
書いている者としては、もしかしたらちょっぴり切ない気持ちになるかもしれません:汗:
日本語版も配布されていますが、現在サイドバーにも載せられるバージョンが出ています。
PluginのDownload
こちらのサイトから、 Popularity Contestをダウンロードする。
日本語版はMMRT daily life様のサイトで配布されています。
ただし、最新版が欲しい方は、こちらのサイト。(サイドバーに人気ランキングが載せられるようになっています。)
ファイルをPluginフォルダへ入れて、Upload。
ダウンロードしたフォルダを解凍し、プラグインフォルダに入れてアップロードし、プラグインを有効にする。
管理画面
管理画面にログインし、ダッシュボードの「Most Popular Posts 」とオプションの「Popularity」から一覧が見れます。
設定(海外版の最新バージョンの場合)
人気度は強制的に指定箇所に表示するようになっています。
任意の箇所に表示したい場合(最新バージョンのこちらのサイトから手に入れた場合)は、popularity-contest.phpの38行目
@define(’AKPC_SHOWPOP’, 1);
popularity-contest.phpの47行目
@define(’AKPC_SHOWHELP’, 1);
以下のように書き換える
38行目@define(’AKPC_SHOWHELP’, 0);
47行目@define(’AKPC_SHOWHELP’, 0);
表示したい箇所に、
<?php akpc_the_popularity(); ?>
を入れる。
以上で終わり
設定(日本語版を使用した場合)
日本語版はMMRT daily life様から配布されているものを使用した場合は、38行目の
$ak_show_popularity_with_post = 1;
を以下のように書き換える。
$ak_show_popularity_with_post = 0;
表示したい箇所に、
<?php akpc_the_popularity(); ?>
を入れて終わり。
サイドバーに表示したい場合(最新バージョンのみ対応?)
同封されている、sidebar.phpを開き必要な箇所を自分の使用しているテーマのsidebar.phpに追加する。
一つは、カテゴリー情報に載せる形と、もう一つは単に今月の人気記事を載せる形らしい(英語苦手でして…(;´▽`A“
カテゴリー情報に載せる形は以下のように書いてあります。
<li>
<?php /* If this is a 404 page */ if (is_404()) { ?>
<?php /* If this is a category archive */ } elseif (is_category()) { ?>
<p>You are currently browsing the archives for the <?php single_cat_title(”); ?> category.</p><li><h2>Most Popular in ‘<?php single_cat_title(”); ?>’</h2>
<ul>
<?php akpc_most_popular_in_cat(); ?>
</ul>
</li><?php /* If this is a yearly archive */ } elseif (is_day()) { ?>
<p>You are currently browsing the <a href=”<?php echo get_settings(’siteurl’); ?>”><?php echo bloginfo(’name’); ?></a> weblog archives
for the day <?php the_time(’l, F jS, Y’); ?>.</p><?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
<p>You are currently browsing the <a href=”<?php echo get_settings(’siteurl’); ?>”><?php echo bloginfo(’name’); ?></a> weblog archives
for <?php the_time(’F, Y’); ?>.</p><li><h2>Most Popular in <?php the_time(’F, Y’); ?></h2>
<ul>
<?php akpc_most_popular_in_month(); ?>
</ul>
</li><?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
<p>You are currently browsing the <a href=”<?php echo get_settings(’siteurl’); ?>”><?php echo bloginfo(’name’); ?></a> weblog archives
for the year <?php the_time(’Y'); ?>.</p><?php /* If this is a monthly archive */ } elseif (is_search()) { ?>
<p>You have searched the <a href=”<?php echo get_settings(’siteurl’); ?>”><?php echo bloginfo(’name’); ?></a> weblog archives
for <strong>’<?php echo wp_lovelog_specialchars($s); ?>’</strong>. If you are unable to find anything in these search results, you can try one of these links.</p><?php /* If this is a monthly archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
<p>You are currently browsing the <a href=”<?php echo get_settings(’siteurl’); ?>”><?php echo bloginfo(’name’); ?></a> weblog archives.</p><?php } ?>
</li>
もう一つは、以下のように追加する形。
<li><h2>Most Popular Posts</h2>
<ul>
<?php akpc_most_popular(); ?>
</ul>
</li>
以上です。
反映されているか確認する。
お疲れ様でした。



