Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- Template Name: Archive Recepten
- */
- get_header(); ?>
- <section id="primary" class="content-area">
- <main id="main" class="site-main" role="main">
- <div id="placeholder"></div>
- <div id="legend"></div>
- <ul id="container" class="search-results-wrap container_3 clearfix">
- <?php $temp = $wp_query; $wp_query = null; $wp_query = new WP_Query(); $wp_query->query('showposts=25&post_type=post'.'&paged='.$paged); while ($wp_query->have_posts()) : $i++; $wp_query->the_post(); ?>
- <li class="result <?php if ( ($i%3) == 0 ) { echo 'grid_1'; } elseif ( ($i%1) == 0 ) { echo 'grid_1'; } ?>" style="height:220px;" data-filter="<?php foreach(get_the_category() as $category) { echo $category->slug . '';} ?>">
- <div class="thumbnail-result">
- <a href="<?php the_permalink(); ?>" rel="bookmark"> <?php if ( (function_exists('category-thumbnail')) && (has_post_thumbnail()) ) {echo get_the_post_thumbnail($post->ID); } else {echo main_image(); } ?> </a>
- </div>
- <div class="result-info">
- <span class="title"><a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a></span>
- <span class="date"><?php the_time('d-m-y') ?></span>
- </div>
- </li>
- <?php endwhile; ?>
- </ul>
- <nav>
- <?php previous_posts_link('« Newer') ?>
- <?php next_posts_link('Older »') ?>
- </nav>
- <?php
- $wp_query = null;
- $wp_query = $temp; // Reset
- ?>
- </main><!-- #main -->
- </section><!-- #primary -->
- <?php get_sidebar(); ?>
- <?php get_footer(); ?>
- <script>
- jQuery(document).ready(function($){
- $.filtrify("container", "placeholder", {
- close : true,
- callback : function( query, match, mismatch ) {
- if ( !mismatch.length ) {
- $("#legend").html("Viewing all projects");
- } else {
- var category, tags, i, tag, legend = "<h4>Currently filtered by:</h4>";
- for ( category in query ) {
- tags = query[category];
- if ( tags.length ) {
- legend += "";
- for ( i = 0; i < tags.length; i++ ) {
- tag = tags[i];
- legend += "" + tag + " ";
- };
- legend += "";
- };
- };
- $("#legend").html( legend );
- };
- }
- });
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment