私はwordpressのカスタムフィールドに問題があります。カスタムフィールドWordpressとforeach
私はサブページがあります。
- ホームPL
- ホームDE
- ホームEN
私はそれぞれの言語で同じです各サブページにカスタムフィールドを追加しました。
例えば
<?php the_field('text1'); ?>
<?php the_field('text2'); ?>
<?php the_field('text3'); ?>
私はそのサブカテゴリからのオファーを表示するループを追加するまで、すべてが正常に動作します。あなたはそれが動作しないカスタムフィールドを追加したいループ以下
例えば
$args = array('post_type' => 'page', 'posts_per_page' => -1,
'post_parent' => 44, 'orderby' => 'title', 'order' => 'ASC',);
$parents = get_posts($args);
foreach ($parents as $post) :
setup_postdata($post);
endforeach;
。これを解決するには?
<?php the_field( 'text'、ID);を追加すると、これは動作し始めますが、他の言語では機能しません –