$options['num_months'] = 1; } $calobj = new ec3_ec3xml($options); switch (ec3_get_listing_q($wp_query)) { case 'E': $calobj->add_events($wp_query); break; case 'P': $calobj->add_posts($wp_query, !$ec3->advanced); break; default: $calobj->add_events($wp_query); $calobj->add_posts($wp_query, !$ec3->advanced); } ob_clean(); $xml .= '<calendar>'; $xml .= $calobj->generate(); $xml .= '<details id="details">'; $xml .= implode('', $calobj->details); $xml .= '</details>'; $xml .= '</calendar>'; //$xml = preg_replace("/\\A\\s*/m", "", $xml); //$xml = preg_replace("/version/", "teste", $xml); //$xml = preg_replace("/(\r\n|\n|\r)/","",$xml); echo $xml; /* <calendar><?php echo $calobj->generate() ?> <details id="details"> <?php echo implode('',$calobj->details) ?> </details> </calendar>*/
remove_filter('the_content', 'ec3_filter_the_content', 20); remove_filter('get_the_excerpt', 'ec3_get_the_excerpt'); add_filter('get_the_excerpt', 'wp_trim_excerpt'); global $ec3, $wp_query; $options = array(); if ($wp_query->is_month) { $options['num_months'] = 1; } $calobj = new ec3_ec3xml($options); switch (ec3_get_listing_q($wp_query)) { case 'E': $calobj->add_events($wp_query); break; case 'P': $calobj->add_posts($wp_query, !$ec3->advanced); break; default: $calobj->add_events($wp_query); $calobj->add_posts($wp_query, !$ec3->advanced); } ?> <calendar><?php echo $calobj->generate(); ?> <details id="details"> <?php echo implode('', $calobj->details); ?> </details> </calendar>