Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <article class="b-article">
- <?php if(have_posts()) : ?>
- <?php while(have_posts()) : the_post(); ?>
- <!-- Хлебные крошки Start -->
- <div class="b-breadcrumbs clearfix">
- <?php breadcrumbs(); ?>
- </div>
- <!-- Хлебные крошки End -->
- <h1><?php the_title();?></h1>
- <?php the_content(); ?>
- <?php endwhile; ?>
- <?php endif; ?>
- <?php
- // Define custom query parameters
- $custom_query_args = array( 'posts_per_page' => 100, 'post_type' => 'products', orderby => 'modified', order => 'ASC');
- // Get current page and append to custom query parameters array
- $custom_query_args['paged'] = get_query_var( 'paged' ) ? get_query_var( 'paged' ) : 1;
- // Instantiate custom query
- $custom_query = new WP_Query( $custom_query_args );
- // Pagination fix
- $temp_query = $wp_query;
- $wp_query = NULL;
- $wp_query = $custom_query;
- // Output custom query loop
- if ( $custom_query->have_posts() ) :
- while ( $custom_query->have_posts() ) :
- $custom_query->the_post();
- ?>
- <div class="col-md-4">
- <div class="product-item">
- <div class="photo">
- <?php echo get_the_post_thumbnail( $id, array(220,150))?>
- </div>
- <div class="title">
- <h4><?php the_title(); ?></h4>
- <span><?php echo get_post_meta($post->ID, 'size', true) ?></span>
- </div>
- <div class="price">
- <a class="b-button open-popup-callback" href="#">Купить</a>
- </div>
- </div>
- </div>
- <?php
- endwhile;
- endif;
- // Reset postdata
- wp_reset_postdata();
- // Reset main query object
- $wp_query = NULL;
- $wp_query = $temp_query;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement