前提・実現したいこと
・無料テーマ Cocoonで人気記事ランキングを「WordPress Popular Posts」をPHP Code Widgetを使って表示させたい
・ランキングの1位、2位、3位の部分をCocoonのcssを反映させたい
・クラス名の no-'.$number.' 部分を no-1 no-2 no-3 ・・・と加算した数字を表示させたい
発生している問題・エラーメッセージ
・ランキングの1位、2位、3位の部分をCocoonデフォルトのcssを反映させたい
→反映させられたが、1~10位まで全部1位の色になってしまった
・クラス名の数字を加算させられない
該当のソースコード
<aside class="widget widget-sidebar widget-sidebar-standard widget_popular_entries"> <?php $number = 0; $number++; $args = array( 'post_type' => 'post', 'limit' => 10, 'range' => 'custom', 'time_quantity' => 1, 'time_unit' => 'hour', 'thumbnail_width' => 120, 'wpp_start' => '<div class="popular-entry-cards widget-entry-cards no-icon cf ranking-visible">', 'wpp_end' => '</div>', 'post_html' => ' <a href="{url}" class="popular-entry-card-link a-wrap no-'.$number.'" title="{text_title}"> <div class="popular-entry-card widget-entry-card e-card cf"> <figure class="popular-entry-card-thumb widget-entry-card-thumb card-thumb">{thumb_img}</figure> <div class="popular-entry-card-content widget-entry-card-content card-content"> <span class="popular-entry-card-title widget-entry-card-title card-title">{text_title}</span> <span class="popular-entry-card-pv widget-entry-card-pv">{views} views</span> </div> </div> </a>' ); wpp_get_mostpopular( $args ); ?> </aside>
no-'.$number.' は no-1 と取得できていますが、加算させることができません。
お手数ですが、よろしくお願いします。
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
退会済みユーザー
2018/11/25 05:44
退会済みユーザー
2018/11/25 06:28