Javascript 在谷歌地图信息窗口中使用表短码获取wordpress帖子内容
我想在谷歌地图信息窗口中显示一个页面内容,只要标签前只有文本,它就可以工作。但是我想包括一个由插件“内联google电子表格查看器”(inlineGoogleSpreadsheet viewer)()的短代码生成的表。当我在标记前面写短代码时,映射被破坏(标记不显示) 这是密码Javascript 在谷歌地图信息窗口中使用表短码获取wordpress帖子内容,javascript,php,wordpress,google-maps,infowindow,Javascript,Php,Wordpress,Google Maps,Infowindow,我想在谷歌地图信息窗口中显示一个页面内容,只要标签前只有文本,它就可以工作。但是我想包括一个由插件“内联google电子表格查看器”(inlineGoogleSpreadsheet viewer)()的短代码生成的表。当我在标记前面写短代码时,映射被破坏(标记不显示) 这是密码 $locations = array(); $this_page_id=$wp_query-
$locations = array();
$this_page_id=$wp_query->post->ID;
$location_query = new WP_Query( array(
'showposts' => 20,
'post_parent' => $this_page_id,
'post_type' => 'page'
) );
echo "//markers: 10\n";
$comma = "";
while ( $location_query->have_posts() ) {
$location_query->the_post();
$title = str_replace("'", "\'", get_the_title());
$permalink = get_permalink();
$content = get_the_content();
$content = apply_filters( 'the_content', $content );
$latitude = get_post_meta( get_the_ID(), 'latitude', true );
$longitude = get_post_meta( get_the_ID(), 'longitude', true );
$locations[]=array(the_title('<h4>','</h4>',false).
'<div id="'.$post->ID.'">'.$post->post_content.'</div><br/><a href="$permalink" class="button">Voir la station</a>',
$latitude,
$longitude,
$NUM++
);
echo "\nvar locations=".json_encode($locations).";\n";
$locations=array();
$this\u page\u id=$wp\u query->post->id;
$location\u query=新的WP\u查询(数组(
“展示柱”=>20,
“post\u parent”=>$this\u page\u id,
“发布类型”=>“页面”
) );
回声“//标记:10\n”;
$逗号=”;
而($location\u query->have\u posts()){
$location\u query->the\u post();
$title=str\u replace(“'”,“\”,获取\u title());
$permalink=get_permalink();
$content=获取内容();
$content=apply_过滤器('the_content',$content);
$latitude=get_post_meta(get_ID(),'latitude',true);
$longitude=get_post_meta(get_ID(),'longitude',true);
$locations[]=数组(_标题(“”,,,false)。
'.$post->post_内容'
',
$latitude,
$longitude,
$NUM++
);
echo“\nvar locations=“.json_encode($locations)”;\n;
我可以在信息窗口中看到内容,但表不显示,只显示短代码文本。如何过滤内容以使其在信息窗口中显示表
谢谢!似乎您在第二个代码中使用了两次
get\u post\u meta(get\u ID(),'latitude',true),
。您可以将其中一行更改为get\u post\u meta(get\u ID(),'longitude',true),
我编辑了代码,但仍然无法让表显示…只有短代码文本!