WordPress プラグインPopular Postsを任意の場所に設置するテンプレートタグ
1 2 3 4 5 6 7 8 9 10 11 12 13 | <?php $wpp = array ( 'range' => 'daily', /*集計期間(daily,weekly,monthly)*/ 'limit' => 5, /*表示数*/ 'post_type' => 'post', /*投稿のみ(固定ページ除外)*/ 'title_length' => '35', /*タイトル文字数*/ 'stats_comments' => '0', /*コメント数非表示*/ 'stats_views' => '1', /*閲覧数表示*/ 'thumbnail_width' => '50', /*画像width(px)*/ 'thumbnail_height' => '50', /*画像height(px)*/ 'post_html' => '<li>{thumb}<span>{title}</span></li>', /*表示されるhtmlの設定(サムネイル、記事タイトル、の順で表示)*/ ); ?> <?php wpp_get_mostpopular($wpp); ?> |
▼参考ページ
https://github.com/cabrerahector/wordpress-popular-posts/wiki