Advertisement
Mary_Pieroszkiewicz

Untitled

Sep 24th, 2019
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.02 KB | None | 0 0
  1.  <div class="jku-post-grid-items-wrapper">
  2.                            
  3.                             <?php
  4.                             // The post
  5.                             while ( $wp_query->have_posts() ) : $wp_query->the_post(); ?>
  6.                                 <div class="jku-post-grid-item">
  7.                                     <?php if ( has_post_thumbnail() ) { ?>
  8.                                         <a class="jku-post-grid-image" href="<?php the_permalink(); ?>">
  9.                                         <?php the_post_thumbnail(); ?>
  10.  
  11.                                     <?php } else { ?>
  12.                                         <a class="jku-image-placeholder" href="<?php the_permalink(); ?>">
  13.  
  14.                                     <?php }
  15.                                     if ( has_term( 'wideo', 'kategorie-przepisow' ) ) {
  16.                                         echo '<img class="jku-video-post-icon" src="/wp-content/themes/jakub-kuron/svg/jkuron-icon-video0.svg" /></img>';
  17.                                     }
  18.                                     echo '</a>';
  19.                                     ?>
  20.  
  21.                                     <h5 class="jku-post-grid-categories">
  22.                                         <?php
  23.                                             $term_list = wp_get_post_terms($post->ID, 'kategorie-przepisow', array("fields" => "all"));  
  24.                                             foreach($term_list as $term_single) {
  25.                                                 echo '<span><a href="' . esc_url(get_term_link( $term_single )) . '">' . $term_single->name . '</a></span>';
  26.                                             }
  27.                                         ?>
  28.                                     </h5>
  29.                                     <a class="jku-post-grid-title" href="<?php the_permalink(); ?>"><h3><?php echo get_the_title(); ?></h3></a>
  30.                                 </div>
  31.                             <?php endwhile;
  32.                         ?>
  33.                         </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement