2012-04-10 74 views
0

当我在循环中调用get_post_custom时,它可以正常工作。但它在我的屏幕上打印38。这是一个WP错误或什么?我该如何解决它?调用屏幕上的get_post_custom输出38

更多信息: 它也发生在我打电话给get_post_meta时。我正在使用自定义字段模板插件。

$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; 
+0

你可以发布你的代码吗? – Yaniro 2012-04-10 06:48:13

回答