現在wordpressの固定ページのテンプレートpage.phpに固定ページ毎にカテゴリー別の記事を表示する
コードを入れました。
<!-- 新着記事表示 --> <?php $cat_id = get_cat_ID( get_the_title() ); if ( $cat_id ) { $args = array( 'posts_per_page' => 14, // 表示件数の指定 'category' => $cat_id, ); } $posts = get_posts( $args ); foreach ( $posts as $post ): // ループの開始 setup_postdata( $post ); // 記事データの取得 ?> <!-- imgTextBox --> <div class="imgTextBox"> <p class="textP"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a><br><span class="postDate"><?php echo get_the_date( $format, $post ); ?></span><span class="writeName"><?php the_author(); ?></span></p> <p class="imgP"><a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('thumbnail'); ?></a></p> </div> <!-- imgTextBox --> <?php endforeach; // ループの終了 wp_reset_postdata(); // 直前のクエリを復元する ?> <!-- 新着記事表示 -->
しかし、これだとカテゴリー別記事一覧が邪魔をして会社概要やお問い合わせフォームなどが作れません。
wordpressは静的なhtmlページみたいに色々な内容のページを追加するには固定ページしかないのでしょうか?
そしてどうやったら会社概要やお問い合わせフォームのページを作る事ができるでしょうか?
回答1件
あなたの回答
tips
プレビュー