サポート » 使い方全般 » シングルページで同じ内容が表示されてしまう現象

  • http://s-14.jp/?cat=30

    このinformationページ(カテゴリー30のページ)の右側、記事タイトル一覧の2つの記事タイトル一覧各タイトルから表示されるページのURLは異なっているにも関わらず、表示される内容が同一になってしまいます。

    ソースは下記の通りです。
    <!–記事タイトルと内容表示部分–>
    <?php query_posts(“posts_per_page=3&cat=30”); ?>
    <?php if(have_posts()): while(have_posts()): the_post(); ?>
    <div class=”info_title_left”>
    [<?php the_date(Y.m.d);?>]  <?php the_title();?>
    </div>
    <div class=”info_text_left”><?php the_content();?>
    </div>

    <?php endwhile; endif; ?>
    </div>
    <!–info_left終わり–>

    <!–カテゴリ記事一覧を表示–>
    <div class=”info_right”>
    <div class=”info_title”></div>
    <!–ループ開始–>
    <div class=”info_list”>
    <?php query_posts(“posts_per_page=10&cat=30”); ?>
    <?php if(have_posts()): while(have_posts()): the_post(); ?>
    “>+ [<?php the_time(Y.n.j);?>]<?php the_title();?>
    <?php endwhile; endif; ?>
    </div>

    もしかして、記事本文部分と記事タイトル一覧表示部分でquery_posts(“posts_per_page=10&cat=30”);  を2回つかっていることが原因かとも思い、いろいろ方法を試してみたのですが、改善されません。

    ちなみに、シングルページの当該箇所表示ソースは以下で、表示件数以外は以下のようにカテゴリーページと同じコードを設置しています。

    <?php if(in_category(30)):?>
    <div class=”info_box”>
    <div class=”info_header”>S-14 information</div>

    <!–記事内容–>
    <div class=”info_left”>
    <?php query_posts(“posts_per_page=1&cat=30”); ?>
    <?php if(have_posts()): while(have_posts()): the_post(); ?>
    <div class=”info_title_left”>
    [<?php the_date(Y.m.d);?>]  <?php the_title();?>
    </div>
    <div class=”info_text_left”><?php the_content();?>
    </div>

    <?php endwhile; endif; ?>
    </div>
    <!–info_left終わり–>

    <!–記事タイトル一覧–>
    <div class=”info_right”>
    <div class=”info_title”></div>
    <!–ループ開始–>
    <div class=”info_list”>
    <?php query_posts(“posts_per_page=10&cat=30”); ?>
    <?php if(have_posts()): while(have_posts()): the_post(); ?>
    “>+ [<?php the_time(Y.n.j);?>]<?php the_title();?>
    <?php endwhile; endif; ?>
    </div>
    </div>
    </div>

    ご教授いただけますと有り難いです。

  • トピック「シングルページで同じ内容が表示されてしまう現象」には新たに返信することはできません。