wordpressで運営しているブログのサイドバーにカテゴリーごとに人気の記事を設置したいと考えています。
下記URLの記事を参考に、カスタマイズし、無事人気記事が表示されるようになったのですが、サムネイル画像や、カエレバ等で読み込んでいる画像が全て読み込まれない状態になってしまいました。
下記コードの問題点をご指摘いただけないでしょうか?
<?php if (is_single() || is_category()) {?> <h4 class="widgettitle "><span>同じカテゴリの人気記事</span></h4> <?php $cat_now = get_the_category(); $cat_now = $cat_now[0]; $now_id = $cat_now->cat_ID; ?> <script type="text/javascript"> $(function(){ $('#popular-post ul li').each(function(i){ $(this).attr('class','number' + (i+1)); }); }); </script> <?php if (function_exists('wpp_get_mostpopular')) { $args = ' limit=5& range=monthly& order_by=views& thumbnail_width=80& thumbnail_height=80& cat="'.$now_id.'"& stats_views=0& stats_comments=0'; wpp_get_mostpopular($args); } }else{ ?> <h4 class="widgettitle "><span>今注目の人気記事</span></h4> <script type="text/javascript"> $(function(){ $('#popular-post ul li').each(function(i){ $(this).attr('class','number' + (i+1)); }); }); </script> <?php if(function_exists('wpp_get_mostpopular')){ $args = ' limit=10& range=weekly& order_by=views& thumbnail_width=80& thumbnail_height=80& cat="'.$now_id.'"& stats_views=0& stats_comments=0'; wpp_get_mostpopular($args); } } ?>
あなたの回答
tips
プレビュー