grid-layout1.php
3 years ago
grid-layout3.php
3 years ago
grid-layout4.php
3 years ago
grid_hover-layout1.php
3 years ago
grid_hover-layout2.php
3 years ago
grid_hover-layout3.php
3 years ago
list-layout1.php
3 years ago
list-layout2.php
3 years ago
list-layout3.php
3 years ago
grid-layout1.php
95 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Grid Layout Template - 1 |
| 4 | * |
| 5 | * @package RT_TPG |
| 6 | */ |
| 7 | |
| 8 | use RT\ThePostGrid\Helpers\Fns; |
| 9 | |
| 10 | // Do not allow directly accessing this file. |
| 11 | if ( ! defined( 'ABSPATH' ) ) { |
| 12 | exit( 'This script cannot be accessed directly.' ); |
| 13 | } |
| 14 | |
| 15 | $pID = get_the_ID(); |
| 16 | $excerpt = Fns::get_the_excerpt( $pID, $data ); |
| 17 | $title = Fns::get_the_title( $pID, $data ); |
| 18 | |
| 19 | if ( 'custom' !== $data['title_visibility_style'] ) { |
| 20 | $title = get_the_title(); |
| 21 | } |
| 22 | /** |
| 23 | * Get post link markup |
| 24 | * $link_start, $link_end, $readmore_link_start, $readmore_link_end |
| 25 | */ |
| 26 | |
| 27 | $post_link = Fns::get_post_link( $pID, $data ); |
| 28 | extract( $post_link ); |
| 29 | |
| 30 | //Grid Column: |
| 31 | $grid_column_desktop = '0' !== $data['grid_column'] ? $data['grid_column'] : '4'; |
| 32 | $grid_column_tab = '0' !== $data['grid_column_tablet'] ? $data['grid_column_tablet'] : '6'; |
| 33 | $grid_column_mobile = '0' !== $data['grid_column_mobile'] ? $data['grid_column_mobile'] : '12'; |
| 34 | $col_class = "rt-col-md-{$grid_column_desktop} rt-col-sm-{$grid_column_tab} rt-col-xs-{$grid_column_mobile}"; |
| 35 | |
| 36 | // Column Dynamic Class. |
| 37 | $column_classes = []; |
| 38 | |
| 39 | $column_classes[] .= $data['hover_animation']; |
| 40 | $column_classes[] .= 'rt-grid-item'; |
| 41 | |
| 42 | if ( 'masonry' == $data['layout_style'] ) { |
| 43 | $column_classes[] .= 'masonry-grid-item'; |
| 44 | } |
| 45 | ?> |
| 46 | |
| 47 | <div <?php post_class( esc_attr( $col_class . ' ' . implode( ' ', $column_classes ) ) ); ?> |
| 48 | data-id="<?php echo esc_attr( $pID ); ?>"> |
| 49 | <div class="rt-holder tpg-post-holder"> |
| 50 | <div class="rt-detail rt-el-content-wrapper"> |
| 51 | <?php |
| 52 | if ( 'show' == $data['show_thumb'] ) : |
| 53 | $has_thumbnail = has_post_thumbnail() ? 'has-thumbnail' : 'has-no-thumbnail'; |
| 54 | ?> |
| 55 | <div class="rt-img-holder tpg-el-image-wrap <?php echo esc_attr( $has_thumbnail ); ?>"> |
| 56 | <?php Fns::get_post_thumbnail( $pID, $data, $link_start, $link_end ); ?> |
| 57 | </div> |
| 58 | <?php endif; ?> |
| 59 | |
| 60 | <?php |
| 61 | if ( 'show' == $data['show_title'] ) { |
| 62 | Fns::get_el_post_title( $data['title_tag'], $title, $link_start, $link_end, $data ); |
| 63 | } |
| 64 | ?> |
| 65 | |
| 66 | <?php if ( 'show' == $data['show_meta'] ) : ?> |
| 67 | <div class="post-meta-tags rt-el-post-meta"> |
| 68 | <?php Fns::get_post_meta_html( $pID, $data ); ?> |
| 69 | </div> |
| 70 | <?php endif; ?> |
| 71 | |
| 72 | |
| 73 | <?php if ( 'show' == $data['show_excerpt'] || 'show' == $data['show_acf'] ) : ?> |
| 74 | <div class="tpg-excerpt tpg-el-excerpt"> |
| 75 | <?php if ( $excerpt && 'show' == $data['show_excerpt'] ) : ?> |
| 76 | <div class="tpg-excerpt-inner"> |
| 77 | <?php echo wp_kses_post( $excerpt ); ?> |
| 78 | </div> |
| 79 | <?php endif; ?> |
| 80 | <?php Fns::tpg_get_acf_data_elementor( $data, $pID ); ?> |
| 81 | </div> |
| 82 | <?php endif; ?> |
| 83 | |
| 84 | <?php |
| 85 | if ( rtTPG()->hasPro() && 'show' === $data['show_social_share'] ) { |
| 86 | echo wp_kses( \RT\ThePostGridPro\Helpers\Functions::rtShare( $pID ), Fns::allowedHtml() ); |
| 87 | } |
| 88 | if ( 'show' === $data['show_read_more'] && $data['read_more_label'] ) { |
| 89 | Fns::get_read_more_button( $data, $readmore_link_start, $readmore_link_end ); |
| 90 | } |
| 91 | ?> |
| 92 | </div> |
| 93 | </div> |
| 94 | </div> |
| 95 |