word press初心者です。
投稿ページに固定ページのタイトルを表示したいのですが
<?php $args = array( 'post_type' => 'page' ); $the_query = new WP_Query( $args ); if( $the_query->have_posts()) : while( $the_query->have_posts()) : $the_query->the_post() ; ?> <h2><?php the_title(); ?></h2> <?php endwhile ; endif ; ?>
上記コードをsingle.phpに書いた所画面に表示されませんでした。
よろしくお願いいたします。
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/07/14 05:17
退会済みユーザー
2017/07/14 05:47
2017/07/14 06:32