'; $XML .= ""; $XML .= get_ALC_API_Version(); $XML .= categoryListXML($alc_api_options); // category listing $XML .= "_LATEST_ARTICLES_"; // just return selected category id //$XML .= articleListImageSizeXML($alc_api_options); // list image size if (!empty($alc_api_options['cat'])) { //print_r($alc_api_options['cat']); /* Query posts for the latest articles */ $args = array('post_type' => 'post', 'category__in' => $alc_api_options['cat'], 'posts_per_page' => $posts_per_page, 'paged' => $page); $cat_query = new WP_Query($args); $XML .= "" . $cat_query->max_num_pages . ""; // added total page count if ($cat_query->have_posts()) { while ($cat_query->have_posts()) : $cat_query->the_post(); $XML .= "
"; $XML .= "" . get_the_ID() . ""; $XML .= "" . get_the_title() . ""; $XML .= "" . get_permalink() . ""; if (!empty($cat_query->post->post_excerpt)) { $description = $cat_query->post->post_excerpt; } else { $description = $cat_query->post->post_content; } $description = stripHtmlTags($description); $XML .= ""; $XML .= "" . get_the_time("Y-m-d H:i") . ""; $thumbnail_id = get_post_meta(get_the_ID(), '_thumbnail_id', true); $XML .= ""; if (!empty($thumbnail_id)) { $xml_thumb = wp_get_attachment_image_src($thumbnail_id, 'full'); $xml_thumb_src = get_tim_thumb($xml_thumb[0], THUMB_WIDTH_2x, THUMB_HEIGHT_2x); $XML .= $xml_thumb_src; } $XML .= ""; $XML .= "
"; endwhile; wp_reset_postdata(); } $XML .= "1"; $XML .= ""; } else { $XML .= "-1"; $XML .= "No categories"; } $XML .= "
"; header("Content-Type:text/xml"); echo $XML; //print_r ($alc_api_options['cat']); ?>