我正在尝试将一组post ID连接在一起。现在,我的代码似乎是为每个ID创建一个单独的数组,而不是为每个ID创建一个数组。
这是我想出的代码。它位于包含的内部taxonomy.php
文件
因此,基本上,我正在尝试获取每个帖子的ID,该ID将来自对给定分类术语的查询。
我觉得我错过了一些很明显的东西?我已经尝试将变量置于循环之外,但它只会输出第一个post ID。
<?php
if( function_exists( \'wpseo_local_show_map\' ) ) {
while (have_posts()) : the_post();
$post_ids = get_the_ID();
var_dump($post_ids);
endwhile;
$params = array(
\'id\' => $post_ids,
\'echo\' => true,
\'width\' => 425,
\'height\' => 350,
\'zoom\' => 10,
\'show_route\' => true
);
wpseo_local_show_map( $params );
}
?>
var\\u转储looks like this. 有人能给我指出正确的方向吗?