Advertisement
Guest User

Untitled

a guest
Aug 7th, 2017
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.75 KB | None | 0 0
  1. <article class="b-article">
  2.             <?php if(have_posts()) : ?>
  3.             <?php while(have_posts()) : the_post(); ?>
  4.            
  5.             <!-- Хлебные крошки Start -->
  6.             <div class="b-breadcrumbs clearfix">
  7.               <?php breadcrumbs(); ?>
  8.             </div>
  9.             <!-- Хлебные крошки End -->
  10.  
  11.             <h1><?php the_title();?></h1>
  12.            
  13.             <?php the_content(); ?>
  14.  
  15.             <?php endwhile; ?>
  16.             <?php endif; ?>
  17.  
  18.  
  19. <?php
  20. // Define custom query parameters
  21. $custom_query_args = array( 'posts_per_page' => 100, 'post_type' => 'products', orderby => 'modified', order => 'ASC');
  22.  
  23. // Get current page and append to custom query parameters array
  24. $custom_query_args['paged'] = get_query_var( 'paged' ) ? get_query_var( 'paged' ) : 1;
  25.  
  26. // Instantiate custom query
  27. $custom_query = new WP_Query( $custom_query_args );
  28.  
  29. // Pagination fix
  30. $temp_query = $wp_query;
  31. $wp_query   = NULL;
  32. $wp_query   = $custom_query;
  33.  
  34. // Output custom query loop
  35. if ( $custom_query->have_posts() ) :
  36.     while ( $custom_query->have_posts() ) :
  37.         $custom_query->the_post();
  38.             ?>
  39.  
  40.  
  41. <div class="col-md-4">
  42.   <div class="product-item">
  43.     <div class="photo">
  44.       <?php echo get_the_post_thumbnail( $id, array(220,150))?>
  45.     </div>
  46.     <div class="title">
  47.       <h4><?php the_title(); ?></h4>
  48.       <span><?php echo get_post_meta($post->ID, 'size', true) ?></span>
  49.  
  50.     </div>
  51.     <div class="price">
  52.      
  53.       <a class="b-button open-popup-callback" href="#">Купить</a>
  54.     </div>
  55.   </div>
  56. </div>
  57.  
  58.  
  59.   <?php
  60.     endwhile;
  61. endif;
  62. // Reset postdata
  63. wp_reset_postdata();
  64.  
  65.  
  66. // Reset main query object
  67. $wp_query = NULL;
  68. $wp_query = $temp_query;
  69.  
  70. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement