PluginProbe ʕ •ᴥ•ʔ
The Post Grid – Shortcode, Gutenberg Blocks and Elementor Addon for Post Grid / 7.0.2
The Post Grid – Shortcode, Gutenberg Blocks and Elementor Addon for Post Grid v7.0.2
7.9.3 7.9.2 trunk 4.0.0 4.0.1 4.0.2 4.0.3 4.0.4 4.0.5 4.1.0 4.1.1 4.1.2 4.1.3 4.1.4 4.1.5 4.2.0 4.2.1 4.2.2 4.2.3 5.0.0 5.0.1 5.0.2 5.0.3 5.0.4 5.0.5 6.0.0 7.0.0 7.0.1 7.0.2 7.1.0 7.2.0 7.2.1 7.2.10 7.2.11 7.2.2 7.2.3 7.2.4 7.2.5 7.2.6 7.2.7 7.2.8 7.2.9 7.3.0 7.3.1 7.4.0 7.4.1 7.4.2 7.4.3 7.5.0 7.6.0 7.6.1 7.7.0 7.7.1 7.7.10 7.7.11 7.7.12 7.7.13 7.7.14 7.7.15 7.7.16 7.7.17 7.7.18 7.7.19 7.7.2 7.7.20 7.7.21 7.7.22 7.7.3 7.7.4 7.7.5 7.7.6 7.7.7 7.7.8 7.7.9 7.8.0 7.8.1 7.8.2 7.8.3 7.8.4 7.8.5 7.8.6 7.8.7 7.8.8 7.8.9 7.9.0 7.9.1
the-post-grid / templates / layouts / layout12.php
the-post-grid / templates / layouts Last commit date
isotope1.php 3 years ago layout1.php 3 years ago layout12.php 3 years ago layout2.php 3 years ago layout3.php 3 years ago layout5.php 3 years ago layout6.php 3 years ago layout7.php 3 years ago
layout12.php
129 lines
1 <?php
2 /**
3 * Layout Template - 12
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 $html = $metaHtmltop = $metaHtmlbottom = $titleHtml = $catHtml = null;
16
17 if ( in_array( 'categories', $items ) && $categories ) {
18 $catHtml .= "<span class='categories-links'>";
19
20 if ( $catIcon ) {
21 $catHtml .= "<i class='".Fns::change_icon( 'fas fa-folder-open', 'flaticon-folder' )."'></i>";
22 }
23
24 $catHtml .= "{$categories}</span>";
25 }
26
27 if ( in_array( 'post_date', $items ) && $date ) {
28 $metaHtmltop .= "<span class='date-meta'>";
29
30 if ( $metaIcon ) {
31 $metaHtmltop .= "<i class='" . Fns::change_icon( 'far fa-calendar-alt', 'flaticon-calendar' ) . "'></i>";
32 }
33
34 $metaHtmltop .= "{$date}</span>";
35 }
36
37 if ( in_array( 'author', $items ) ) {
38 $metaHtmltop .= "<span class='author'>";
39
40 if ( $metaIcon ) {
41 $metaHtmltop .= "<i class='" . Fns::change_icon( 'fa fa-user', 'flaticon-user' ) . "'></i>";
42 }
43
44 $metaHtmltop .= "{$author}</span>";
45 }
46
47 $metaHtmltop .= $catHtml;
48
49 if ( in_array( 'tags', $items ) && $tags ) {
50 $metaHtmltop .= "<span class='post-tags-links'>";
51
52 if ( $metaIcon ) {
53 $metaHtmltop .= "<i class='" . Fns::change_icon( 'fa fa-tags', 'flaticon-tag' ) . "'></i>";
54 }
55
56 $metaHtmltop .= "{$tags}</span>";
57 }
58
59 $num_comments = get_comments_number(); // get_comments_number returns only a numeric value
60
61 if ( in_array( 'comment_count', $items ) && $comment ) {
62 $metaHtmltop .= '<span class="comment-count"><a href="' . get_comments_link() . '">';
63
64 if ( $metaIcon ) {
65 $metaHtmltop .= "<i class='". Fns::change_icon( 'fas fa-comments', 'flaticon-chat' ) . "'></i>";
66 }
67
68 $metaHtmltop .= $num_comments . '</a></span>';
69 }
70
71 if ( ! empty( $metaHtmltop ) && $metaPosition == 'above_title' ) {
72 $titleHtml .= "<div class='post-meta-user {$metaSeparator}'>$metaHtmltop</div>";
73 }
74
75 if ( in_array( 'title', $items ) ) {
76 $titleHtml .= sprintf( '<%1$s class="entry-title"><a data-id="%2$s" class="%3$s" href="%4$s"%5$s>%6$s</a></%1$s>', $title_tag, $pID, $anchorClass, $pLink, $link_target, $title );
77 }
78
79 $postMetaBottom = null;
80
81 if ( in_array( 'read_more', $items ) ) {
82 $postMetaBottom .= "<span class='read-more'><a data-id='{$pID}' class='{$anchorClass}' href='{$pLink}'{$link_target}>{$read_more_text}</a></span>";
83 }
84
85 $html .= sprintf( '<div class="%s" data-id="%d">', esc_attr( implode( ' ', [ $grid, $class ] ) ), $pID );
86 $html .= sprintf( '<div class="rt-holder%s">', $tpg_title_position ? ' rt-with-title-' . $tpg_title_position : null );
87
88 if ( $tpg_title_position == 'above' ) {
89 $html .= sprintf( '<div class="rt-detail rt-with-title">%s</div>', $titleHtml );
90 }
91
92 if ( $imgSrc ) {
93 $html .= '<div class="rt-img-holder">';
94 $html .= "<a data-id='{$pID}' class='{$anchorClass}' href='{$pLink}'{$link_target}>{$imgSrc}</a>";
95 $html .= '</div> ';
96 }
97
98 $html .= "<div class='rt-detail'>";
99
100 if ( $tpg_title_position == 'below' ) {
101 $html .= $titleHtml;
102 }
103
104 if ( ! empty( $metaHtmltop ) && ( empty( $metaPosition ) || $metaPosition == 'above_excerpt' ) ) {
105 $html .= "<div class='post-meta-user {$metaSeparator}'>$metaHtmltop</div>";
106 }
107
108 if ( ! $tpg_title_position ) {
109 $html .= $titleHtml;
110 }
111
112 if ( in_array( 'excerpt', $items ) ) {
113 $html .= "<div class='tpg-excerpt'>{$excerpt}</div>";
114 }
115
116 if ( ! empty( $metaHtmltop ) && $metaPosition == 'below_excerpt' ) {
117 $html .= "<div class='post-meta-user {$metaSeparator}'>$metaHtmltop</div>";
118 }
119
120 if ( ! empty( $postMetaBottom ) ) {
121 $html .= "<div class='post-meta {$btn_alignment_class}'>$postMetaBottom</div>";
122 }
123
124 $html .= '</div>';
125 $html .= '</div>';
126 $html .= '</div>';
127
128 Fns::print_html( $html );
129