カテゴリーごとの表示

フォーラム 使い方全般 カテゴリーごとの表示

  • このトピックには1件の返信、1人の参加者があり、最後にtomohiroにより9年、 9ヶ月前に更新されました。
2件の投稿を表示中 - 1 - 2件目 (全2件中)
  • 投稿者
    投稿
  • #71105
    tomohiro
    参加者

    ご利用の環境
    ——————————————-
    WordPress のバージョン:3.9.1
    Welcart のバージョン:1.4.2
    ご利用のテーマ:オリジナル
    症状を確認したブラウザ:
    サーバー(会社名、サービス名):
    SSLの利用: 
    WordPress のパーマリンク設定:
    ——————————————–

    カテゴリーごとの表示を触っているのですが、対象カテゴリーを含む、全てのカテゴリが表示されてしまいます。

    <?php if (have_posts()) the_post(); ?>
    <?php $paged = $wp_query->query_vars['paged']; ?>
    <?php $category_name = get_post_meta($post->ID, 'category_slug', true); ?>
    <?php $posts_per_page = get_post_meta($post->ID, 'posts_per_page', true); ?>
    <?php $order = get_post_meta($post->ID, 'order', true); ?>
    <?php query_posts('category_name=' . $category_name . '&status=post&paged=' . $paged . '&posts_per_page=' . $posts_per_page . '&order='. $order); ?>
    							
    <ul id="itemListBox">
    <?php if (have_posts()) : while (have_posts()) : the_post(); usces_the_item(); ?>
    <li>
    <div class="itemThumbnail"><a>"><?php usces_the_itemImage($number = 0, $width = 600, $height = 600 ); ?></a></div>
    <div class="itemName"><a>" rel="bookmark"><?php usces_the_itemName(); ?></a></div>
    <div class="ItemPrice"><?php usces_crform( usces_the_firstPrice('return'), true, false ); ?><?php usces_guid_tax(); ?></div>
    </li>
    <?php endwhile; else: ?>
    <?php endif; ?>

    何かが不足しているのでしょうか。
    宜しくお願い致します。

    • このトピックはyasumaxが9年、 9ヶ月前に変更しました。
    #71109
    tomohiro
    参加者

    自己解決しました
    Welcartデフォルトテーマのarchive.phpのソースを参考にして書き直しました。

    <?php if (have_posts()) : ?>
    <ul id="itemListBox">
    <?php while (have_posts()) : the_post(); ?>							
    <li>
    <div class="itemThumbnail"><a>"><?php usces_the_itemImage($number = 0, $width = 600, $height = 600 ); ?></a></div>
    <div class="itemName"><a>" rel="bookmark"><?php usces_the_itemName(); ?></a></div>
    <?php if (!usces_have_zaiko_anyone()) : ?>
    <div class="itemStatus">売切れ</div>
    <?php else : ?>
    <div class="ItemPrice"><?php usces_crform( usces_the_firstPrice('return'), true, false ); ?><?php usces_guid_tax(); ?></div>
    <?php endif; ?>
    </li>
    <?php endwhile; ?>
    </ul>
    <?php else : ?>
    <?php endif; ?>
    • この返信は9年、 9ヶ月前にyasumaxが編集しました。
2件の投稿を表示中 - 1 - 2件目 (全2件中)
  • このトピックに返信するにはログインが必要です。