• 掲題のとおりなのですが、現状Popular Postsを使って、固定ページのみに対して
    人気ページを表示させるようにしています。

    その際、たとえば会社概要といったある特定の固定ページは
    集計から除外されるようにしたいのですが、どのように対応すべきでしょうか。

    また、固定ページの場合は、Popular Postsの表示結果にはそのページのサムネイルとタイトルしか出力することができないのでしょうか?
    記事のように、ページ内の本文の抜粋(20文字など)を表示することはできないのでしょうか。

    ちなみに現在、サイドバーにテキストウィジェットを設定して、その中にPHP Codeを使って以下のように記載をしております。
    ==================================================================
    <style>
    ul.popular-posts-custom li {
    border-bottom-width: 1px;
    border-bottom-style: dotted;
    border-bottom-color: #999999;
    list-style-type: none;
    display: block;
    padding-top: 5px;
    padding-right: 1px;
    padding-bottom: 5px;
    padding-left: 1px;
    font-size: 9px;
    }
    ul.popular-posts-custom li:after{
    content: “.”;
    display: block;
    height: 0;
    font-size:0;
    clear: both;
    visibility:hidden;
    }
    .txt {
    overflow: auto;
    }
    .wpp-views {
    background-color: #FFCCCC !important;
    color: red !important;
    display: inline !important;
    font-style: normal !important;
    font-weight: bold !important;
    font-size: 9px;
    }
    </style>
    <?php if (function_exists(‘wpp_get_mostpopular’)): ?>
    <div class=”popular-posts-custom”>
    <?php
    // オプションの設定
    $args = array(
    ‘limit’ => 5, // 表示する記事数
    ‘range’ => ‘monthly’, // 期間
    ‘order_by’ => ‘views’, // ソート順(これは閲覧数)
    ‘post_type’ => ‘page’, // 投稿タイプ(カスタム投稿タイプを表示したくない場合など)
    ‘thumbnail_width’ => 70, // サムネイルの横幅
    ‘thumbnail_height’ => 70, // サムネイルの高さ
    ‘stats_comments’ => 0, // コメントを表示する(1)/表示しない(0)
    ‘stats_views’ => 0, // 閲覧数を表示する(1)/表示しない(0)
    ‘stats_author’ => 0, // 投稿者を表示する(1)/表示しない(0)
    ‘stats_date’ => 0, // 日付を表示する(1)/表示しない(0)
    ‘stats_date_format’ => ‘Y.n.j’, // 日付のフォーマット
    ‘stats_category’ => 1, // カテゴリを表示する(1)/表示しない(0)
    ‘excerpt_length’ => ’25’, /*本文テキストの文字数*/
    ‘wpp_start’ => “<ul class=’popular-posts-custom’>”, // リストの開始タグ
    ‘wpp_end’ => “”, // リストの終了タグ
    ‘post_html’ => // HTMLの出力フォーマット

    • <article>
      <div class=’img’>{thumb}</div>
      <div class=’txt’>
      <p>{text_title}</p>
      <div class=’date’><time>{stats}</time></div>
      </div>
      </article>

    • );

      // 関数の実行
      wpp_get_mostpopular($args);
      ?>
      </div>
      <?php endif; ?>
      =================================================================

      ご指導いただけますと幸いでございます。

  • トピック「WordPress Popular Postsで特定の固定ページを表示させたくない」には新たに返信することはできません。