• はじめて、投稿させて頂きます。重複したスレッドがないようでしたので建てさせて頂きます。
    もしございましたら、申し訳ございません。

    複数の人間で投稿するタイプのサイトを構築しているんですが、カスタム投稿”book”,
    カスタム投稿”writer”を作成しました。

    カスタム投稿”writer”をsingle-writer.php内で表示させ、かつその投稿者が投稿した
    カスタム投稿”book”の投稿をsingle-writer内に一覧で表示したいのですが
    上手く行きません。

    `

      <?php
      $args = array(
      ‘author’=>( $author ),
      ‘posts_per_page’ => -1,
      ‘offset’ => 0,
      ‘cat’ => 0,
      ‘orderby’ => ‘post_date’,
      ‘order’ => ‘DESC’,
      ‘post_type’ => ‘book’,
      ‘post_status’ => ‘publish’,
      ‘suppress_filters’ => true,
      ‘ignore_sticky_posts’ => true,
      ‘no_found_rows’ => true
      );
      $the_query = new WP_Query( $args );
      if ( $the_query->have_posts() ) {
      while ( $the_query->have_posts() ) {
      $the_query->the_post();
      ?>

    • <h4>“><?php the_title(); ?></h4><!–タイトル –>
    • <?php
      }
      }
      wp_reset_postdata(); ?>

    のように書いてみたのですが
    bookの一覧は表示されますが
    他の投稿者のものも一緒に出てしまっています。
    お分かりになるかたがいらっしゃればご指摘お願いします。

3件の返信を表示中 - 1 - 3件目 (全3件中)
3件の返信を表示中 - 1 - 3件目 (全3件中)
  • トピック「カスタム投稿の著者アーカイブ」には新たに返信することはできません。