3
我想寫一個短代碼嵌套在其中的另一個短代碼。 [map id =「1」] shortcode是從一個不同的插件生成的,但我想在執行這個簡碼時顯示地圖。爲wordpress輸出回聲內的短代碼
我不認爲這是最好的方式去做這件事,但我仍然是新的PHP編碼。
<?php
add_shortcode('single-location-info', 'single_location_info_shortcode');
function single_location_info_shortcode(){
return '<div class="single-location-info">
<div class="one-half first">
<h3>Header</h3>
<p>Copy..............</p>
</div>
<div class="one-half">
<h3>Header 2</h3>
<p>Copy 2............</p>
<?php do_shortcode('[map id="1"]'); ?>
</div>
</div>';
}
?>
我不認爲我應該嘗試從迴歸中調用PHP ....我雖然我讀的地方,我應該使用「定界符」,但我一直無法得到它的正常工作。
任何雖然?
謝謝
你的WordPress的解決方案完美地工作!謝謝!!!! – William