前提・実現したいこと
現在wordpressの記事投稿で、ACF(Advanced Custom Fields pro)プラグインでカスタムフィールド内で記事作成をしております。
通常のコンテンツエディタ内は空の状態で、カスタムフィールド内のコンテンツをページングしたいために、the_contentに出力することができないかと考えております。
試したこと
素人すぎてわからない前提なのですが
single.php内で
php
1 <section class="content"> 2 3 <?php if( get_field('xxxxxx') ) { ?> 4 <div class="item-excerpt"> 5 <?php the_field('xxxxxx'); ?> 6 </div> 7 <?php } ?> 8 9 <?php if( get_field( 'xxxxxx2' ) == 'show' ): ?> 10 <div class="item-xxxxxx2"> 11 </div> 12 <?php endif; ?> 13 14 <div id="article"> 15 <?php while(the_flexible_field("contents")): ?> 16 <?php if(get_row_layout() == "post"): ?> 17 <?php the_sub_field("c_post"); ?> 18 <?php endif; ?> 19 <?php endwhile; ?> 20 21 </section>
のようにカスタムフィールドで記載したものは記事としてきちんと出ているのですが、ページングするにはthe_contentでないと無理のようで、なんとかくっつけたいと考えております。
ページングについて
https://teratail.com/questions/49962
こちらのページを参考に見ました。
お手数をお掛けしますが、
ご検討のほどよろしくお願いいたします。
あなたの回答
tips
プレビュー