参考サイト:
https://interest-speaker.com/page-list-with-explanation-is-outputted-by-wordpress/
目次
必要なもの:
Advanced Custom Fields [WPプラグイン]
準備:
Advanced Custom Fieldsでテキストエリアsummary作成。
コード:
ループの中で使用。
<li> <div> <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a> </div> <p><?php echo esc_html( $post->summary ); ?></p> </li>
注意点:
WP標準装備のカスタムフィールドでも可能だが、Advanced Custom Fieldsと併用すると標準の方が表示されなくなる。
コメント