-1

これら 2 つの php 関数<?php the_field('city'); ?>を以下の関数の変数と変数<?php the_field('country'); ?>の代わりに追加する必要があります。$city$country

<?php echo do_shortcode('[forecast location="' . $city . ' , ' . $country. '" caption="" numdays="3" iconset="Cartoon" class="css_table_class" cache="true"]'); ?>

私のPHPはまったく良くなく、エラーが発生し続けています。

ありがとう

4

1 に答える 1

1

the_fieldフィールド値を返す代わりに出力します。必要なものget_the_field:

echo do_shortcode(
    '[forecast location="' . get_the_field('city') . ' , ' . get_the_field('country') . 
    '" caption="" numdays="3" iconset="Cartoon" class="css_table_class" cache="true"]'
); 
于 2012-07-13T17:42:15.727 に答える