フォーラムへの返信

1件の返信を表示中 - 1 - 1件目 (全1件中)
  • トピック投稿者 menber2299

    (@menber2299)

    jim912さま
    jdbbさま

    丁寧にご回答くださりありがとうございました。
    今回はcookieがないときの処理は不必要だったので、下記のようなコードにしてみたところ、無事動作致しました。

    <?php if(isset($_COOKIE[‘hoge’])): ?>
    <?php
    $match_posts = false;
    $cookie_ids = (array) $_COOKIE[‘hoge’];
    $args = array(
    ‘posts_per_page’ => -1,
    ‘post__in’ => $cookie_ids
    );
    query_posts($args);
    ?>

    <?php if(have_posts()): while(have_posts()): the_post(); ?>
    //ここに内容//
    <?php endwhile; endif; ?>
    <?php wp_reset_query(); ?>
    <?php endif; ?>

    お教え頂いた「WP_Query」について、もっと勉強しようと思います。
    本当にありがとうございました。

1件の返信を表示中 - 1 - 1件目 (全1件中)