Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // unlink category function
- function the_category_unlinked($separator = ' ') {
- $categories = (array) get_the_category();
- $thelist = '';
- foreach($categories as $category) { // concate
- $thelist .= $separator . $category->category_nicename;
- }
- echo $thelist;
- }
- // isotope filter menu in wp
- <div class="portfolioFilter">
- <?php
- $terms = get_terms('category');
- $count = count($terms);
- if ( $count > 0 ){
- echo '<div class="the_filter"> <ul id="portfolioFilter" class="clearfix slimmenu">';
- echo '<li><a href="#" data-filter="*">All</a></li>';
- foreach ( $terms as $term ) {
- $termname = strtolower($term->name);
- $termname = str_replace(' ', '-', $termname);
- if ($termname=="ux"):
- echo '<li><a href="#" data-filter="' . '.' . $termname . '" class="active">' . $term->name . '</a></li>';
- else:
- echo '<li><a href="#" data-filter="' . '.' . $termname . '">' . $term->name . '</a></li>';
- endif;
- }
- echo '</ul> </div>';
- }
- ?>
- </div><!--portfolioContainer-->
- // template code with bootstrap 3
- <div class="isotome_area">
- <div class="portfolioFilter">
- <?php
- $terms = get_terms('category');
- $count = count($terms);
- if ( $count > 0 ){
- echo '<div class="the_filter"> <ul id="portfolioFilter" class="clearfix">';
- echo '<li><a href="#" data-filter="*">All</a></li>';
- foreach ( $terms as $term ) {
- $termname = strtolower($term->name);
- $termname = str_replace(' ', '-', $termname);
- if ($termname=="ux"):
- echo '<li><a href="#" data-filter="' . '.' . $termname . '" class="active">' . $term->name . '</a></li>';
- else:
- echo '<li><a href="#" data-filter="' . '.' . $termname . '">' . $term->name . '</a></li>';
- endif;
- }
- echo '</ul> </div>';
- }
- ?>
- </div>
- <div class="row portfolioContainer">
- <?php
- $temp = $wp_query;
- $wp_query = null;
- $wp_query = new WP_Query();
- $wp_query->query('showposts=-1&post_type=post'.'&paged='.$paged);
- while ($wp_query->have_posts()) : $wp_query->the_post();
- ?>
- <!-- LOOP: Usual Post Template Stuff Here-->
- <div id="inner_area" class="food col-xs-12 col-sm-12 col-md-4 col-lg-4 <?php the_category_unlinked(' '); ?>">
- <?php the_post_thumbnail();?>
- </div>
- <!-- LOOP: Usual Post Template Stuff Here-->
- <?php endwhile; ?>
- <?php
- $wp_query = null;
- $wp_query = $temp; // Reset
- ?>
- <!-- post query from a category id-->
- </div>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement