Php 在屏幕上调用get_post_自定义输出38
在循环中调用get_post_custom时,它工作正常。但它在我的屏幕上显示38。这是一个可湿性粉剂错误还是什么?我怎样才能修好它 更多信息: 当我调用get_post_meta时也会发生这种情况。我正在使用自定义字段模板插件Php 在屏幕上调用get_post_自定义输出38,php,wordpress,Php,Wordpress,在循环中调用get_post_custom时,它工作正常。但它在我的屏幕上显示38。这是一个可湿性粉剂错误还是什么?我怎样才能修好它 更多信息: 当我调用get_post_meta时也会发生这种情况。我正在使用自定义字段模板插件 $args = array( 'post_type' => 'attendeeaddress', 'meta_query' => array( array( 'key'
$args = array(
'post_type' => 'attendeeaddress',
'meta_query' => array(
array(
'key' => 'MEETING_ID',
'value' => $meeting_id,
'meta_compare' => '='
)
)
);
$wpquery = new WP_Query($args);
$addresses = array();
while ( $wpquery->have_posts() ) : $wpquery->the_post();
$custom_val = get_post_custom(the_ID());
$addresses[] = array(
"address" => $custom_val["MEETING_ADDRESS"][0],
"meeting_id" => $meeting_id,
"lat" => $custom_val["MEETING_LAT"][0],
"lon" => $custom_val["MEETING_LON"][0],
"name" => $custom_val["NAME"][0]
);
endwhile;
return $addresses;
这是因为_ID()实际上“呼应”了该值 要仅收集值,请使用获取ID() http://codex.wordpress.org/Function_Reference/get_the_ID
- 你只能在循环中使用它李>
- 这是因为这个ID()实际上“呼应”了该值
要仅收集值,请使用获取ID()
http://codex.wordpress.org/Function_Reference/get_the_ID
- 你只能在循环中使用它李>