This repository has been archived on 2019-06-09. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
io-theme-2019/category-press.php
2019-06-09 16:44:48 +02:00

84 lines
1.4 KiB
PHP
Executable File

<?php get_header(); ?>
<main role="main">
<!-- section -->
<section>
<?php
if (have_posts()):
$args = array(
'category_name' => 'press',
'meta_key' => 'project-date',
'orderby' => 'meta_value_num',
'order' => 'DESC',
// 'meta_value' => date( "Y" ), // change to how "event date" is stored
'meta_compare' => '>'
);
query_posts($args);
while (have_posts()) :
the_post();
//if (have_posts()): while (have_posts()) : the_post();
$key_project_date = get_post_meta(get_the_ID(), 'project-date', true);
?>
<!-- article -->
<article id="post-<?php the_ID(); ?>" <?php post_class( 'date-'.$key_project_date); ?>>
<div class="project-tags">
<?php the_tags( '', '', '' ); ?>
</div>
<div class="project-date">
<?php
$key_project_date = get_post_meta(get_the_ID(), 'project-date', true);
if ( ! empty( $key_project_date ) ) {
echo $key_project_date;
}
?>
</div>
<div class="project-content">
<?php
the_content();
the_post_thumbnail('projects-thumb');
?>
</div>
</article>
<!-- /article -->
<?php endwhile; ?>
<?php else: ?>
<!-- article -->
<article>
<h2>
<?php _e( 'Sorry, nothing to display.', 'iotheme' ); ?>
</h2>
</article>
<!-- /article -->
<?php endif; ?>
</section>
<!-- /section -->
</main>
<?php get_footer(); ?>