Forked from walterjaworski/Atualizado e funcionando
Last active
August 29, 2015 14:10
-
-
Save theodorocaliari/a13b1b36a01a5e4d33f5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
global $wp_query; | |
$wp_query = new WP_Query(array( 'post_type' => 'event', 'order' => 'ASC', 'orderby' => array( 'meta_value_num' => 'ASC', 'title' => 'ASC' ), 'meta_key' => 'data_evento', 'posts_per_page' => 6 )); | |
if($wp_query->have_posts()): ?> | |
<?php while ($wp_query->have_posts()): $wp_query->the_post(); ?> | |
<?php | |
$meta = get_field('data_evento'); | |
$dia_semana = date_i18n('l', strtotime($meta)); | |
$dia_mes = date_i18n('d', strtotime($meta)); | |
$mes = date_i18n('M', strtotime($meta)); | |
?> | |
<div class="box-evento-home col-md-2 col-xs-12"> | |
<div class="calendar-small col-md-12"> | |
<span class="s-month" style="text-transform:uppercase;"><?php echo $mes; ?></span> | |
<span class="s-date"><?php echo $dia_mes; ?></span> | |
</div> | |
<div class="event-small-details col-md-12"> | |
<h5 class="event-small-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h5> | |
<div class="event-small-meta small-text"> | |
<p><a href="<?php the_permalink(); ?>"><?php //the_field('data_evento'); ?> + Leia mais</a></p> | |
</div> | |
</div> | |
</div> | |
<?php endwhile; ?> | |
<?php endif; ?> | |
<?php wp_reset_postdata();?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
global $wp_query; | |
$wp_query = new WP_Query(array( 'post_type' => 'event', 'order' => 'ASC', 'orderby' => array( 'meta_value_num' => 'ASC', 'title' => 'ASC' ), 'meta_key' => 'data_evento', 'posts_per_page' => 6, 'meta_query' => array( array( 'key' => 'data_evento', 'value' => date('Ymd'), 'compare' => '>')) )); | |
if($wp_query->have_posts()): ?> | |
<?php while ($wp_query->have_posts()): $wp_query->the_post(); ?> | |
<?php | |
$meta = get_field('data_evento'); | |
$dia_semana = date_i18n('l', strtotime($meta)); | |
$dia_mes = date_i18n('d', strtotime($meta)); | |
$mes = date_i18n('M', strtotime($meta)); | |
?> | |
<div class="box-evento-home col-md-2 col-xs-12"> | |
<div class="calendar-small col-md-12"> | |
<span class="s-month" style="text-transform:uppercase;"><?php echo $mes; ?></span> | |
<span class="s-date"><?php echo $dia_mes; ?></span> | |
</div> | |
<div class="event-small-details col-md-12"> | |
<h5 class="event-small-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h5> | |
<div class="event-small-meta small-text"> | |
<p><a href="<?php the_permalink(); ?>"><?php //the_field('data_evento'); ?> + Leia mais</a></p> | |
</div> | |
</div> | |
</div> | |
<?php endwhile; ?> | |
<?php endif; ?> | |
<?php wp_reset_postdata();?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment