ordenar eventos por ordem decrescente
Na tabela wp_posts, os dados estão assim :
/applications/core/interface/imageproxy/imageproxy.php?img=http://www.hugosenna.com.br/wp2/1.jpg&key=af06382647440c9d698fc8ca45bbd932fad733320814f5c30a2823dea749b819" alt="1.jpg" />
/applications/core/interface/imageproxy/imageproxy.php?img=http://www.hugosenna.com.br/wp2/2.jpg&key=336a61309e4bd6ea420fb1260bc2aabf256a06f2f5ef3f8e7c6b801aa87f6d96" alt="2.jpg" />
e quando insiro algum evento, alem dessa tabela acima, vai dados para wp_postmeta, e ficam assim:
/applications/core/interface/imageproxy/imageproxy.php?img=http://www.hugosenna.com.br/wp2/3.jpg&key=006ab735adc4ac6893e970a13e9c152347ba4e96a82db41c15a2fa80a8eaaad7" alt="3.jpg" />
no arquivo que exibe os eventos fica assim:
<div class="latest-events">
<?php query_posts('post_type=event&posts_per_page=3'); if (have_posts()) : while (have_posts()) : the_post(); ?>
<article class="latest-event cf">
<?php if(ale_get_meta('event_date')) { ?>
<time datetime="2014-08-09" class="date">
<?php $date_event = ale_get_meta('event_date');
$date_event_one = explode('/',$date_event); ?>
<span class="date__day"><?php echo date("d", mktime(0, 0, 0, $date_event_one[0], $date_event_one[1], $date_event_one[2])); ?></span>
<?php echo date("M", mktime(0, 0, 0, $date_event_one[0], $date_event_one[1], $date_event_one[2])); ?>
<span class="date__year"><?php echo date("Y", mktime(0, 0, 0, $date_event_one[0], $date_event_one[1], $date_event_one[2])); ?></span>
</time>
<!-- End date -->
<?php } else { ?>
<time datetime="2014-08-09" class="date">
<span class="date__day"><?php echo get_the_date('d'); ?></span>
<?php echo get_the_date('M'); ?>
<span class="date__year"><?php echo get_the_date('Y'); ?></span>
</time>
<!-- End date -->
<?php } ?>
<div class="latest-event__wrap">
<header class="latest-event__header">
<h1 class="latest-event__title">
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
</h1>
<?php $cur_terms = get_the_terms( $post->ID, 'event-category' );
if($cur_terms != '') { ?>
<p class="latest-event__category">
<?php
foreach($cur_terms as $cur_term){
echo ' '. $cur_term->name.' ';
}
?>
</p>
<?php } ?>
</header>
<!-- End event post header -->
<p><?php trim_content_chars(120,'...') ?></p>
</div>
<!-- End event post wrap -->
<a href="<?php the_permalink(); ?>" class="btn-more">+</a>
</article>
<!-- End event post-->
<?php endwhile; else: ?>
<?php ale_part('notfound')?>
<?php endif; wp_reset_query(); ?>
</div>
<!-- End Events posts -->
a pergunta é: como exbir os eventos por ordem decrescente, sendo que a data do evento vai para a tabela wp_postmeta , no campo meta_value ?
Discussão (1)
Carregando comentários...