Advertisement
Guest User

anchorLinks_permalinks_second_wp_query

a guest
May 9th, 2012
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.91 KB | None | 0 0
  1. <section class="mes1">
  2.     <h1 class="month">|<?php echo 'Abril';?></h1>  
  3. <?php $trimestre1 = null; $trimestre2 = null; $trimestre3 = null;
  4.     $abril = '04'; $maio = '05'; $junho = '06';
  5.     $args1 = array('post_type' => 'event','posts_per_page' => -1,'cat' => '-16,-17',
  6.         'meta_query' => array(
  7.             array('key' => '_start_month','value' => $abril,'compare' => 'IN'),
  8.             array('key' => '_start_year','value' => $today_year,'compare' => '=')
  9.                 ),
  10.         'meta_key' => '_start_eventtimestamp','orderby' => 'meta_value_num','order'=> 'ASC');
  11.  
  12.     $trimestre1 = new WP_Query($args1);
  13.     if ( $trimestre1->have_posts() ) :
  14.     while ( $trimestre1->have_posts() ) : $trimestre1->the_post();?>
  15.     <article>
  16.         <h1 class="hideHeading"><?php the_title(); ?></h1>
  17.         <ul>
  18.         <li class="category"><p>|category</p></li>
  19.         <li class="date"><p><date</p></li>
  20.         <li class="title"><p><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></p></li>
  21.         </ul>      
  22.                
  23.     <?php if ( has_post_thumbnail() ) {?>
  24.     <div class="imagem"><a href="<?php the_permalink() ?>"><?php the_post_thumbnail('thumbnail'); ?>                   
  25.     </a></div>                 
  26. <?php } else{?>
  27.     <div  class="imagem"><a href="<?php the_permalink() ?>"><img src="<?php bloginfo('template_url');
  28.     ?>/images/defaultThumb.jpg"></a></div>
  29. <?php }?>
  30.     </article>
  31. <?php endwhile; ?><?php else : ?><style type="text/css">section.mes3 {display:none}</style>
  32. <?php endif; $trimestre1 = null;$trimestre2 = null;$trimestre3 = null;wp_reset_query();
  33. wp_reset_postdata();?>
  34. </section><section class="mes2">
  35.     <h1 class="month">|<?php echo 'Maio';?></h1>
  36. <?php $trimestre1 = null; $trimestre2 = null; $trimestre3 = null;
  37.     $args2 = array('post_type' => 'event','posts_per_page' => -1,'cat' => '-16,-17',
  38.             'meta_query' => array(array('key' => '_start_month','value' => $maio,
  39.                         'compare' => 'IN'),
  40.                         array('key' => '_start_year','value' => $today_year,
  41.                             'compare' => '=')),
  42.                 'meta_key' => '_start_eventtimestamp','orderby' => 'meta_value_num',
  43.                 'order'=> 'ASC',
  44.     $trimestre2 = new WP_Query($args2);if ( $trimestre2->have_posts() ) :
  45.     while ( $trimestre2->have_posts() ) : $trimestre2->the_post();?>
  46.     <article>
  47.         <h1 class="hideHeading"><?php the_title(); ?></h1>
  48.         <ul>   
  49.         <li class="category"><p >|category</p></li>
  50.         <li class="date"><p>date</p></li>
  51.         <li class="title"><p><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></p></li>
  52.         </ul>  
  53.     <?php if ( has_post_thumbnail() ) {?><div class="imagem"><a href="<?php the_permalink() ?>"><?php  
  54.     the_post_thumbnail('thumbnail'); ?></a></div>                  
  55.     <?php } else{?><div  class="imagem"><a href="<?php the_permalink() ?>"><img src="<?php
  56.     bloginfo('template_url'); ?>/images/defaultThumb.jpg"></a></div>               
  57. <?php }?></article><?php endwhile; ?>
  58. <?php else : ?><style type="text/css">section.mes2 {display:none}</style>
  59. <?php endif;$trimestre1 = null; $trimestre2 = null; $trimestre3 = null; wp_reset_query();
  60. wp_reset_postdata();?></section>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement