Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Template Name: Recepten Index
- */
- get_header(); ?>
- <section id="primary" class="content-area full-width" itemtype="http://schema.org/Blog" itemscope="itemscope" itemprop="mainContentOfPage" role="main">
- <header class="entry-header">
- <h2 class="entry-title" itemprop="headline"><?php the_title(); ?></h2>
- </header><!-- .entry-header -->
- <?php
- $args = array(
- 'post_status' => get_field( 'post_status' ),
- 'category__in' => get_field( 'categories' ),
- 'tag__in' => get_field( 'tags' ),
- 'post_type' => get_field( 'post_type' ),
- 'posts_per_page' => get_field( 'posts_per_page' ),
- 'orderby' => get_field( 'orderby' ),
- 'order' => get_field( 'order' ),
- 'nopaging' => true
- );
- $args['category__in'] = get_field( 'categories' );
- $args['tag__in'] = get_field( 'tags' );
- $postlist = new WP_Query( $args );
- if ( $postlist->have_posts() ) : ?>
- <ul id="filters" class="filter-menu">
- <?php while ( $postlist->have_posts() ) : $postlist->the_post(); ?>
- <?php $posttags = get_the_tags();
- echo '<li><a href="#" class="active" data-filter="*">Alles</a></li>';
- if ($posttags) {
- foreach($posttags as $tag) {
- echo '<li><a href="#" data-filter="' . '.' . $tag->name . '">' . $tag->name . '</a></li>';
- }
- }
- ?>
- <?php endwhile; ?>
- </ul>
- <div id="recepten-index" class="row">
- <?php while ( $postlist->have_posts() ) : $postlist->the_post(); ?>
- <?php $posttags = get_the_tags(); if ($posttags) : $links = array(); foreach($posttags as $tag) {$links[] = $tag->name; } $links = str_replace(' ', '-', $links); $tax = join( " ", $links ); else : $tax = ''; endif; ?>
- <article id="post-<?php the_ID(); ?>" class="recept-item col-md-4 <?php echo strtolower($tax); ?>" itemscope="itemscope" itemtype="http://schema.org/BlogPosting" itemprop="blogPost"> <?php if( has_post_thumbnail() ) { ?>
- <figure class="entry-image">
- <a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'ikbenirisniet' ), the_title_attribute( 'echo=0' ) ) ); ?>"><?php the_post_thumbnail('featured_image'); ?>
- </a>
- </figure>
- <?php } else { ?>
- <figure class="entry-image">
- <a href="<?php the_permalink(); ?>"><img src="<?php echo get_template_directory_uri(); ?>/assets/images/default.jpg" title="<?php the_title(); ?>"/></a>
- </figure>
- <?php } ?>
- <div class="inner-content">
- <header class="entry-header">
- <h2 class="entry-title" itemprop="headline">
- <a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'ikbenirisniet' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
- </header><!-- .entry-header -->
- </div>
- <div class="clear"></div>
- </article><!-- #post-<?php the_ID(); ?> -->
- <?php endwhile; else: ?>
- <div class="error-not-found">Sorry, no content.</div>
- <?php endif; ?>
- </div><!-- #recepten-index -->
- </div>
- </section><!-- #primary -->
- <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement