0
WP Googleマッププロプラグインhttp://www.flippercode.com/を私のサイトに使用して、店舗と場所のリストを表示しています。カスタムポストタイプのマップを表示したいです。このコードを使用しています。WP Google Map Proを1ページで動的に表示するにはどうすればいいですか?
$maptext = '';
if (get_post_meta(get_the_ID(), '_wpgmp_metabox_latitude', true) != '') {
$locationlat = get_post_meta(get_the_ID(), '_wpgmp_metabox_latitude', true);
$locationlong = get_post_meta(get_the_ID(), '_wpgmp_metabox_longitude', true);
$maptext.= '[[display_map width="100%" height="210" zoom="15" language="en" map_type="ROADMAP" map_draggable="true" marker1="';
$maptext.= $locationlat;
$maptext.= ' | ';
$maptext.= $locationlong;
$maptext.= ' | ' . get_the_title() . '"]]';
echo do_shortcode($maptext);
}
しかし、出力が [display_map幅のようなだけショートが来る= "100%" 高さ= "210" ズーム= "15" 言語= "EN" map_type = "ロードマップ" map_draggable = "true" をMARKER1 =」 27.7172453 | 85.3239605 | Pizza "]
do_shortcodeが動作していないか、コードにエラーがあります。
ありがとうございます。
'add_shortcode'でショートコードを追加し、' do_shortcode'でそれを使う必要があります。 add_shortcodeの詳細https://codex.wordpress.org/Function_Reference/add_shortcode – zipkundan
ありがとうございます。 –