1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
|
<?php $query_cat_grid = new WP_Query( array( 'posts_per_page' => penci_get_number_of_cat_top_grid(), 'cat' => get_queried_object_id(), ) ); if ( ! $query_cat_grid->have_posts() ) { return; }
$post_placeholder = 4 - intval( $query_cat_grid->post_count );
?> <div class="penci-category-grid penci-catgrid-s3"> <div class="penci-container"> <?php $cat_grid_i = 1; $bgrid_count = 1; while ( $query_cat_grid->have_posts() ) : $query_cat_grid->the_post();
$post_id = get_the_ID();
if ( 1 == $cat_grid_i ) { ?> <div class="penci-pitems-wrap clearfix"> <article <?php post_class( 'penci-post-item penci-pitem-big penci-text-below-img penci-pitem-' . $cat_grid_i ); ?>> <?php echo Penci_Helper_Shortcode::get_image_holder_pre( array( 'image_size' => 'penci-thumb-1920-auto', 'class' => 'penci-gradient', 'show_icon' => true, 'size_icon' => 'icon_pos_right', 'hide_review' => true, ) ); ?> <div class="penci-post-info"> <?php echo Penci_Helper_Shortcode::get_post_meta( array( 'cat' ), array( 'hide_cat' => false ), false ); echo Penci_Helper_Shortcode::get_markup_title_post( 10 ); echo Penci_Helper_Shortcode::get_post_meta( array( 'date', 'comment' ), array( 'hide_post_date' => false, 'hide_comment' => false ), true, array( 'author', 'view' ) ); ?> </div> </article> <div class="penci-pitem-smalls"> <?php } else { ?> <article <?php post_class( 'penci-post-item penci-pitem-small penci-text-below-img penci-pitem-' . $cat_grid_i ); ?>> <?php echo Penci_Helper_Shortcode::get_image_holder_pre( array( 'image_size' => 'penci-thumb-480-480', 'class' => 'penci-gradient', 'show_icon' => true, 'size_icon' => 'icon_pos_right', 'hide_review' => true, ) ); ?> <div class="penci-post-info"> <?php echo Penci_Helper_Shortcode::get_post_meta( array( 'cat' ), array( 'hide_cat' => false ), false ); echo Penci_Helper_Shortcode::get_markup_title_post( 10 ); ?> </div> </article> <?php } ?> <?php if ( $bgrid_count == 4 || $cat_grid_i == $query_cat_grid->post_count ) {
if( $post_placeholder ) { for( $i = 1; $i <= $post_placeholder; $i ++ ) {
$cat_grid_i2 = $cat_grid_i + $i; ?> <article <?php post_class( 'penci-post-item penci-pitem-small penci-pitem-placeholder penci-pitem-' . $cat_grid_i2 ); ?>> <?php echo Penci_Helper_Shortcode::get_image_holder_pre( array( 'hide_review' => true, ) ); ?> </article> <?php } }
echo '</div></div>'; $bgrid2_count = 0; }
$bgrid_count ++; $cat_grid_i ++; endwhile; ?> </div> </div> </div> <?php wp_reset_postdata();
|