2012-07-13 3 views
-1

이 두 PHP 함수 <?php the_field('city'); ?><?php the_field('country'); ?>$city$country 변수 대신 아래 함수에 추가해야합니다.이 기본 php 함수를 결합하십시오

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

내 PHP가별로 좋지 않은 도움을 주시면 감사하겠습니다.

감사

답변

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"]' 
); 
관련 문제