SHARE
TWEET

Untitled

a guest Jun 15th, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2. Events Category Template
  3. */
  4.  
  5. // get posts
  6. $posts = array(
  7.     'post_type'         => 'post',
  8.     'posts_per_page'    => -1,
  9.     'post_status'       => 'publish',
  10.     'category_name'     => 'agenda',
  11.     'orderby'           => 'meta_value',
  12.     'meta_key'          => "event_date_end",
  13.     'meta_compare'      => '>=',
  14.     //'meta_value'      => date("Ymd"),
  15.     'meta_value'        => date_i18n("Ymd"),
  16.     'orderby'           => 'meta_value_num',
  17.     'order'             => 'ASC',
  18.  );
  19.  
  20. $posts=get_posts($posts);
  21.  
  22. get_header(); ?>
  23.  
  24.  
  25. <div id="main-content">
  26.     <div class="container">
  27.         <h1 class="cat-title"><?php echo single_cat_title(); ?></h1>
  28.         <div id="content-area" class="clearfix">
  29.             <div id="left-area">
  30.             <?php if( $posts ): ?>
  31.  
  32.                 <?php foreach( $posts as $post ):
  33.                     setup_postdata( $post );?>
  34.  
  35.                                <!-- content goes here -->
  36.  
  37.                 <?php endforeach; ?>
  38.  
  39.                 <?php wp_reset_postdata(); ?>
  40.  
  41.             <?php endif; ?>
  42.  
  43.             </div> <!-- #left-area -->
  44.  
  45.             <?php get_sidebar(); ?>
  46.         </div> <!-- #content-area -->
  47.     </div> <!-- .container -->
  48. </div> <!-- #main-content -->
  49.  
  50. <?php
  51.  
  52. get_footer();
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top