'; $XML .= "
"; $XML .= get_ALC_API_Version(); if (!empty($post)) { //echo '
';
    //print_r($post);
    //echo '
'; $XML .= "" . get_the_title($post_id) . ""; $XML .= "" . get_permalink($post_id) . ""; //$thumbnail_id = get_post_meta(get_the_ID(), '_thumbnail_id', true); $description = apply_filters('the_content', $post->post_content); $XML .= ""; $args = array('post_type' => 'attachment', 'numberposts' => -1, 'post_status' => null, 'post_parent' => $post_id); $attachments = get_posts($args); $XML .= ""; if ($attachments) { foreach ($attachments as $img) { if (wp_attachment_is_image($img->ID)) { $XML .= ""; $XML .= "" . $img->post_content . ""; $XML .= "" . $img->guid . ""; $XML .= ""; } } } $XML .= ""; /* Query comments for post */ $comments_count = get_comment_count($post_id); $XML .= "".$comments_count['approved'].""; $XML .= "1"; $XML .= ""; } else { $XML .= "-1"; $XML .= "Invaild post id"; } $XML .= "
"; header("Content-Type:text/xml"); echo $XML; ?>