The Post Grid - Version 2.3.0

Version Description

  • Titles limit
  • Title hover color
  • Layout Preview
Download this release

Release Info

Developer techlabpro1
Plugin Icon 128x128 The Post Grid
Version 2.3.0
Comparing to
See all releases

Code changes from version 2.2.73 to 2.3.0

README.txt CHANGED
@@ -4,7 +4,7 @@ Donate link:
4
  Tags: post grid, content grid, post display, post format, post view, blog display, news display, post
5
  Requires at least: 4.5
6
  Tested up to: 5.2
7
- Stable tag: 2.2.73
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -41,6 +41,7 @@ By using The Post Grid plugin you can display your post in Grid List & Isotope v
41
  * Pagination Supported
42
  * Feature image Enable/Disable option
43
  * Widget is added
 
44
 
45
 
46
 
@@ -138,6 +139,11 @@ For any bug or suggestion please mail support@radiustheme.com
138
 
139
  == Changelog ==
140
 
 
 
 
 
 
141
  = 2.2.73 =
142
  * Fix Excerpt issue
143
 
4
  Tags: post grid, content grid, post display, post format, post view, blog display, news display, post
5
  Requires at least: 4.5
6
  Tested up to: 5.2
7
+ Stable tag: 2.3.0
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
41
  * Pagination Supported
42
  * Feature image Enable/Disable option
43
  * Widget is added
44
+ * **Layout preview**
45
 
46
 
47
 
139
 
140
  == Changelog ==
141
 
142
+ = 2.3.0 =
143
+ * Titles limit
144
+ * Title hover color
145
+ * **Layout Preview**
146
+
147
  = 2.2.73 =
148
  * Fix Excerpt issue
149
 
assets/css/admin.css CHANGED
@@ -1,18 +1,22 @@
1
  /* tab css */
2
- .tpg-hidden{
3
  display: none;
4
  }
5
- .rt-loading{
 
6
  background: url('../images/loading.gif') no-repeat center center;
7
  padding: 11px;
8
  }
 
9
  body.post-type-rttpg div#misc-publishing-actions, body.post-type-rttpg div#minor-publishing-actions {
10
  display: none;
11
  }
 
12
  div#rttpg_meta_marketing {
13
  background: #3E6BFF;
14
  color: #fff;
15
  }
 
16
  div#rttpg_meta_marketing a.button-link {
17
  color: red;
18
  text-decoration: none;
@@ -20,17 +24,20 @@ div#rttpg_meta_marketing a.button-link {
20
  display: block;
21
  text-align: center;
22
  }
 
23
  div#rttpg_meta_marketing h2 {
24
  color: #fff;
25
  }
 
26
  #sc-tabs ul.rt-tab-nav {
27
  clear: both;
28
  margin-top: 0;
29
  padding: 0;
30
- display:inline-block;
31
  width: 100%;
32
  margin-bottom: -4px;
33
  }
 
34
  #sc-tabs ul.rt-tab-nav li {
35
  background: none repeat scroll 0 0 rgb(230, 230, 230);
36
  cursor: pointer;
@@ -38,13 +45,16 @@ div#rttpg_meta_marketing h2 {
38
  float: left;
39
  margin: 0;
40
  }
 
41
  #sc-tabs ul.rt-tab-nav li:focus {
42
  outline: none;
43
  }
44
- #sc-tabs ul.rt-tab-nav li.ui-tabs-active a , #sc-tabs ul.rt-tab-nav li a:hover{
 
45
  background: #8cc63e;
46
  }
47
- #sc-tabs ul.rt-tab-nav li.ui-tabs-active a:after , #sc-tabs ul.rt-tab-nav li a:hover:after{
 
48
  width: 0;
49
  height: 0;
50
  border-left: 10px solid transparent;
@@ -58,7 +68,8 @@ div#rttpg_meta_marketing h2 {
58
  margin: auto;
59
  content: "";
60
  }
61
- #sc-tabs ul.rt-tab-nav li a{
 
62
  text-decoration: none;
63
  display: block;
64
  padding: 8px 15px;
@@ -67,78 +78,95 @@ div#rttpg_meta_marketing h2 {
67
  color: #fff;
68
  position: relative;
69
  }
70
- #sc-tabs ul.rt-tab-nav li:last-child a{
 
71
  border-right: 0;
72
  }
73
- #sc-tabs ul.rt-tab-nav li a:focus{
 
74
  -webkit-box-shadow: none;
75
  box-shadow: none;
76
  }
77
 
78
- .rt-tab-container{
79
- display: none;
80
- border: 1px solid #e7e7e7;
81
- }
82
- .rt-tab-container .field-holder:first-child{
 
83
  border-top: none;
84
  padding-top: 15px;
85
  }
 
86
  .field-holder .field .full {
87
  width: 100%;
88
  }
 
89
  .rt-tpg-filter.taxonomy {
90
  background: #D8ECBC;
91
  }
 
92
  .term-filter-item-container > .field-holder.term-filter-item-operator {
93
  border-top: none;
94
  }
 
95
  .term-filter-item-container {
96
- border:1px solid #5BA2D2;
97
  }
98
- .term-filter-item-container{
 
99
  border-top: none;
100
  }
101
- .term-filter-item-container:first-child{
102
- border-top:1px solid #5BA2D2;
 
103
  }
104
 
105
- .rt-tab-container .field-holder, .rt-tpg-filter.taxonomy .rt-tpg-filter-item .field-holder:first-child, .rt-tpg-filter-container > .field-holder:first-child{
106
  border-top: 1px solid #e7e7e7;
107
  }
108
- .rt-tpg-filter.taxonomy .rt-tpg-filter-item .field-holder:first-child,.rt-tpg-filter-container > .field-holder:first-child,div#sc-post-post-source > .field-holder > .field > .field-holder:first-child {
 
109
  padding-top: 10px;
110
  }
111
- .rt-tpg-filter-container .field-holder,.rt-tpg-filter-holder > h3{
 
112
  border-bottom: 1px solid #e7e7e7;
113
  }
114
- .rt-tpg-filter-holder > h3{
 
115
  background: #0071bd;
116
  color: #fff;
117
  }
118
 
119
- .rt-tpg-filter.taxonomy .field-holder,.rt-tpg-filter.order > .rt-tpg-filter-item > .field-holder > .field > .field-holder,.rt-tpg-filter-holder .rt-tpg-filter:last-child .rt-tpg-filter-item > .field-holder{
120
  border-bottom: none;
121
  }
122
- .rt-tab-container .field-holder .field-label{
 
123
  float: left;
124
  max-width: 150px;
125
  width: 25%;
126
  }
127
- .rt-tab-container .field-holder .field{
 
128
  float: right;
129
  width: 75%;
130
  }
131
- .rt-tab-container .field-holder:after{
 
132
  clear: both;
133
- content:".";
134
  visibility: hidden;
135
  display: block;
136
  height: 0;
137
  }
138
- .rt-setting-holder .field-holder{
139
- padding:10px;
 
140
  }
141
- .rt-setting-holder .field-holder .field-label{
 
142
  margin-bottom: 10px;
143
  font-weight: bold;
144
  }
@@ -146,20 +174,24 @@ div#rttpg_meta_marketing h2 {
146
  .field-holder .checkbox-group > label {
147
  margin-right: 15px;
148
  }
149
- .checkbox-group.vertical > label , .radio-group.vertical > label{
 
150
  display: block;
151
  margin-bottom: 5px;
152
  }
 
153
  input.large-text.code.rt-code-sc {
154
  color: #fff;
155
  background: #8cc63e;
156
  font-weight: bold;
157
  padding-top: 3px;
158
  }
159
- .rt-textarea{
 
160
  width: 100%;
161
  height: 150px;
162
  }
 
163
  .rt-setting-holder .custom-css {
164
  border: 1px solid #DFDFDF;
165
  -moz-border-radius: 3px;
@@ -172,13 +204,15 @@ input.large-text.code.rt-code-sc {
172
  }
173
 
174
  /* settings page */
175
- .rt-help{
176
  background: #fff;
177
  padding: 10px 20px;
178
  }
179
- .rt-response{
 
180
  padding: 5px;
181
  }
 
182
  .rt-response.updated, .rt-response.error {
183
  padding-top: 5px;
184
  padding-bottom: 5px;
@@ -189,32 +223,35 @@ input.large-text.code.rt-code-sc {
189
  float: left;
190
  }
191
 
192
- .pro-features {
193
- background: #3E6BFF;
194
- color: #fff;
195
- padding: 30px;
196
- width: 90%;
197
  }
198
- .pro-features h3 {
199
- color: #fff;
 
200
  margin-top: 0px;
201
  padding-bottom: 6px;
202
  border-bottom: 1px solid #fff;
203
  }
204
- .pro-features .button-link {
205
- color: #fff;
206
- background: #FF1F10 !important;
207
- padding: 10px 20px;
208
- text-decoration: none;
 
209
  margin-top: 5px;
210
  }
211
- .pro-features .button-link:hover {
212
- color: #ffffff;
213
- text-decoration: underline;
 
214
  }
215
 
216
  @media (max-width: 767px ) {
217
- .rt-setting-holder .field-holder{
218
  float: none;
219
  width: 100%;
220
  }
1
  /* tab css */
2
+ .tpg-hidden {
3
  display: none;
4
  }
5
+
6
+ .rt-loading {
7
  background: url('../images/loading.gif') no-repeat center center;
8
  padding: 11px;
9
  }
10
+
11
  body.post-type-rttpg div#misc-publishing-actions, body.post-type-rttpg div#minor-publishing-actions {
12
  display: none;
13
  }
14
+
15
  div#rttpg_meta_marketing {
16
  background: #3E6BFF;
17
  color: #fff;
18
  }
19
+
20
  div#rttpg_meta_marketing a.button-link {
21
  color: red;
22
  text-decoration: none;
24
  display: block;
25
  text-align: center;
26
  }
27
+
28
  div#rttpg_meta_marketing h2 {
29
  color: #fff;
30
  }
31
+
32
  #sc-tabs ul.rt-tab-nav {
33
  clear: both;
34
  margin-top: 0;
35
  padding: 0;
36
+ display: inline-block;
37
  width: 100%;
38
  margin-bottom: -4px;
39
  }
40
+
41
  #sc-tabs ul.rt-tab-nav li {
42
  background: none repeat scroll 0 0 rgb(230, 230, 230);
43
  cursor: pointer;
45
  float: left;
46
  margin: 0;
47
  }
48
+
49
  #sc-tabs ul.rt-tab-nav li:focus {
50
  outline: none;
51
  }
52
+
53
+ #sc-tabs ul.rt-tab-nav li.ui-tabs-active a, #sc-tabs ul.rt-tab-nav li a:hover {
54
  background: #8cc63e;
55
  }
56
+
57
+ #sc-tabs ul.rt-tab-nav li.ui-tabs-active a:after, #sc-tabs ul.rt-tab-nav li a:hover:after {
58
  width: 0;
59
  height: 0;
60
  border-left: 10px solid transparent;
68
  margin: auto;
69
  content: "";
70
  }
71
+
72
+ #sc-tabs ul.rt-tab-nav li a {
73
  text-decoration: none;
74
  display: block;
75
  padding: 8px 15px;
78
  color: #fff;
79
  position: relative;
80
  }
81
+
82
+ #sc-tabs ul.rt-tab-nav li:last-child a {
83
  border-right: 0;
84
  }
85
+
86
+ #sc-tabs ul.rt-tab-nav li a:focus {
87
  -webkit-box-shadow: none;
88
  box-shadow: none;
89
  }
90
 
91
+ .rt-tab-container {
92
+ display: none;
93
+ border: 1px solid #e7e7e7;
94
+ }
95
+
96
+ .rt-tab-container .field-holder:first-child {
97
  border-top: none;
98
  padding-top: 15px;
99
  }
100
+
101
  .field-holder .field .full {
102
  width: 100%;
103
  }
104
+
105
  .rt-tpg-filter.taxonomy {
106
  background: #D8ECBC;
107
  }
108
+
109
  .term-filter-item-container > .field-holder.term-filter-item-operator {
110
  border-top: none;
111
  }
112
+
113
  .term-filter-item-container {
114
+ border: 1px solid #5BA2D2;
115
  }
116
+
117
+ .term-filter-item-container {
118
  border-top: none;
119
  }
120
+
121
+ .term-filter-item-container:first-child {
122
+ border-top: 1px solid #5BA2D2;
123
  }
124
 
125
+ .rt-tab-container .field-holder, .rt-tpg-filter.taxonomy .rt-tpg-filter-item .field-holder:first-child, .rt-tpg-filter-container > .field-holder:first-child {
126
  border-top: 1px solid #e7e7e7;
127
  }
128
+
129
+ .rt-tpg-filter.taxonomy .rt-tpg-filter-item .field-holder:first-child, .rt-tpg-filter-container > .field-holder:first-child, div#sc-post-post-source > .field-holder > .field > .field-holder:first-child {
130
  padding-top: 10px;
131
  }
132
+
133
+ .rt-tpg-filter-container .field-holder, .rt-tpg-filter-holder > h3 {
134
  border-bottom: 1px solid #e7e7e7;
135
  }
136
+
137
+ .rt-tpg-filter-holder > h3 {
138
  background: #0071bd;
139
  color: #fff;
140
  }
141
 
142
+ .rt-tpg-filter.taxonomy .field-holder, .rt-tpg-filter.order > .rt-tpg-filter-item > .field-holder > .field > .field-holder, .rt-tpg-filter-holder .rt-tpg-filter:last-child .rt-tpg-filter-item > .field-holder {
143
  border-bottom: none;
144
  }
145
+
146
+ .rt-tab-container .field-holder .field-label {
147
  float: left;
148
  max-width: 150px;
149
  width: 25%;
150
  }
151
+
152
+ .rt-tab-container .field-holder .field {
153
  float: right;
154
  width: 75%;
155
  }
156
+
157
+ .rt-tab-container .field-holder:after {
158
  clear: both;
159
+ content: ".";
160
  visibility: hidden;
161
  display: block;
162
  height: 0;
163
  }
164
+
165
+ .rt-setting-holder .field-holder {
166
+ padding: 10px;
167
  }
168
+
169
+ .rt-setting-holder .field-holder .field-label {
170
  margin-bottom: 10px;
171
  font-weight: bold;
172
  }
174
  .field-holder .checkbox-group > label {
175
  margin-right: 15px;
176
  }
177
+
178
+ .checkbox-group.vertical > label, .radio-group.vertical > label {
179
  display: block;
180
  margin-bottom: 5px;
181
  }
182
+
183
  input.large-text.code.rt-code-sc {
184
  color: #fff;
185
  background: #8cc63e;
186
  font-weight: bold;
187
  padding-top: 3px;
188
  }
189
+
190
+ .rt-textarea {
191
  width: 100%;
192
  height: 150px;
193
  }
194
+
195
  .rt-setting-holder .custom-css {
196
  border: 1px solid #DFDFDF;
197
  -moz-border-radius: 3px;
204
  }
205
 
206
  /* settings page */
207
+ .rt-help {
208
  background: #fff;
209
  padding: 10px 20px;
210
  }
211
+
212
+ .rt-response.loading {
213
  padding: 5px;
214
  }
215
+
216
  .rt-response.updated, .rt-response.error {
217
  padding-top: 5px;
218
  padding-bottom: 5px;
223
  float: left;
224
  }
225
 
226
+ .pro-features {
227
+ background: #3E6BFF;
228
+ color: #fff;
229
+ padding: 30px;
230
+ width: 90%;
231
  }
232
+
233
+ .pro-features h3 {
234
+ color: #fff;
235
  margin-top: 0px;
236
  padding-bottom: 6px;
237
  border-bottom: 1px solid #fff;
238
  }
239
+
240
+ .pro-features .button-link {
241
+ color: #fff;
242
+ background: #FF1F10 !important;
243
+ padding: 10px 20px;
244
+ text-decoration: none;
245
  margin-top: 5px;
246
  }
247
+
248
+ .pro-features .button-link:hover {
249
+ color: #ffffff;
250
+ text-decoration: underline;
251
  }
252
 
253
  @media (max-width: 767px ) {
254
+ .rt-setting-holder .field-holder {
255
  float: none;
256
  width: 100%;
257
  }
assets/css/thepostgrid.css CHANGED
@@ -6,41 +6,50 @@
6
  -moz-box-sizing: border-box;
7
  box-sizing: border-box;
8
  }
 
9
  .rt-tpg-container *:before,
10
  .rt-tpg-container *:after {
11
  -webkit-box-sizing: border-box;
12
  -moz-box-sizing: border-box;
13
  box-sizing: border-box;
14
  }
 
15
  .container {
16
  margin-right: auto;
17
  margin-left: auto;
18
  padding-left: 15px;
19
  padding-right: 15px;
20
  }
 
21
  .container-fluid {
22
  margin-right: auto;
23
  margin-left: auto;
24
  padding-left: 15px;
25
  padding-right: 15px;
26
  }
 
27
  .rt-tpg-container ul {
28
  margin: 0;
29
  }
 
30
  .rt-tpg-container i {
31
  margin-right: 5px;
32
  }
 
33
  .clearfix:before, .clearfix:after, .container:before, .container:after, .container-fluid:before, .container-fluid:after, .row:before, .row:after {
34
  content: " ";
35
  display: table;
36
  }
 
37
  .clearfix:after, .container:after, .container-fluid:after, .row:after {
38
  clear: both;
39
  }
 
40
  .row {
41
  margin-left: -15px;
42
  margin-right: -15px;
43
  }
 
44
  .rt-col-xs-24,
45
  .rt-col-sm-24, .rt-col-md-24, .rt-col-lg-24,
46
  .rt-col-xs-1,
@@ -50,16 +59,70 @@
50
  padding-left: 15px;
51
  padding-right: 15px;
52
  }
53
- .rt-col-xs-24,.rt-col-xs-1, .rt-col-xs-2, .rt-col-xs-3, .rt-col-xs-4, .rt-col-xs-5, .rt-col-xs-6, .rt-col-xs-7, .rt-col-xs-8, .rt-col-xs-9, .rt-col-xs-10, .rt-col-xs-11, .rt-col-xs-12 {
 
54
  float: left;
55
  }
56
- .rt-col-xs-24{ width: 20%; } .rt-col-xs-12 { width: 100%; } .rt-col-xs-11 { width: 91.66666667%; } .rt-col-xs-10 { width: 83.33333333%; } .rt-col-xs-9 { width: 75%; } .rt-col-xs-8 { width: 66.66666667%; } .rt-col-xs-7 { width: 58.33333333%; } .rt-col-xs-6 { width: 50%; } .rt-col-xs-5 { width: 41.66666667%; } .rt-col-xs-4 { width: 33.33333333%; } .rt-col-xs-3 { width: 25%; } .rt-col-xs-2 { width: 16.66666667%; } .rt-col-xs-1 { width: 8.33333333%; }
57
- .img-responsive {
58
- max-width: 100%;
59
- display: block;
 
 
 
 
 
 
 
60
  }
61
- .rt-tpg-container .rt-equal-height {
62
- margin-bottom: 15px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63
  }
64
 
65
  /**********************************************************************/
@@ -74,23 +137,28 @@
74
  content: "";
75
  display: block;
76
  }
 
77
  .post-meta-user {
78
- padding: 0px 0px 8px;
79
  font-size: 90%;
80
  }
 
81
  .post-meta-tags {
82
  padding: 0 0 5px 0;
83
  font-size: 90%;
84
  }
 
85
  .post-meta-user span, .post-meta-tags span {
86
  display: inline-block;
87
  padding-right: 5px;
88
  }
 
89
  .post-meta-user span.comment-link {
90
  text-align: right;
91
  float: right;
92
  padding-right: 0;
93
  }
 
94
  .post-meta-user span.post-tags-links {
95
  padding-right: 0;
96
  }
@@ -102,10 +170,12 @@
102
  .rt-tpg-container .layout1 .rt-holder {
103
  padding-bottom: 15px;
104
  }
 
105
  .rt-tpg-container .layout1 .rt-holder .rt-img-holder {
106
  position: relative;
107
  overflow: hidden;
108
  }
 
109
  .rt-tpg-container .layout1 .rt-holder .rt-img-holder img {
110
  -webkit-transition: all 1.1s ease;
111
  -moz-transition: all 1.1s ease;
@@ -114,6 +184,7 @@
114
  transition: all 1.1s ease;
115
  max-width: 100%;
116
  }
 
117
  .rt-tpg-container .layout1 .rt-holder .rt-img-holder:hover img {
118
  -webkit-transform: scale(1.1);
119
  -moz-transform: scale(1.1);
@@ -121,6 +192,7 @@
121
  -o-transform: scale(1.1);
122
  transform: scale(1.1);
123
  }
 
124
  .rt-tpg-container .layout1 .rt-holder .rt-img-holder .overlay {
125
  width: 100%;
126
  height: 100%;
@@ -136,20 +208,28 @@
136
  transition: all 0.3s ease-out 0s;
137
  text-align: center;
138
  }
 
139
  .rt-tpg-container .layout1 .rt-holder .rt-img-holder .overlay .view-details {
140
  display: inline-block;
141
  font-size: 20px;
142
  }
 
143
  .rt-tpg-container .layout1 .rt-holder .rt-img-holder:hover .overlay {
144
  opacity: 1;
145
  }
 
146
  .rt-tpg-container .layout1 .rt-holder .rt-img-holder .active {
147
  opacity: 1;
148
  }
 
149
  .rt-tpg-container .layout1 .rt-holder .rt-detail {
150
  background: #fff;
151
  padding: 15px 0;
152
  }
 
 
 
 
153
  .rt-tpg-container .layout1 .rt-holder .rt-detail h2,
154
  .rt-tpg-container .layout1 .rt-holder .rt-detail h3,
155
  .rt-tpg-container .layout1 .rt-holder .rt-detail h4 {
@@ -158,6 +238,7 @@
158
  font-size: 24px;
159
  line-height: 1.25;
160
  }
 
161
  .rt-tpg-container .layout1 .rt-holder .view-details {
162
  width: 36px;
163
  height: 36px;
@@ -167,19 +248,23 @@
167
  -moz-border-radius: 50%;
168
  -webkit-border-radius: 50%;
169
  }
 
170
  .rt-tpg-container .layout1 .rt-holder .view-details i {
171
  color: #fff;
172
  text-align: center;
173
  padding: 8px 14px;
174
  }
 
175
  .rt-tpg-container .layout1 .rt-holder .rt-detail .post-meta {
176
  text-align: right;
177
  margin-top: 10px;
178
  }
 
179
  .rt-tpg-container .layout1 .rt-holder .rt-detail .read-more {
180
  display: block;
181
  text-align: right;
182
  }
 
183
  .rt-tpg-container .layout1 .rt-holder .rt-detail .read-more a {
184
  padding: 6px 12px;
185
  border-radius: 5px;
@@ -197,6 +282,7 @@
197
  .rt-tpg-container .layout2 .rt-holder {
198
  padding-bottom: 15px;
199
  }
 
200
  .rt-tpg-container .layout2 .rt-holder .rt-img-holder img {
201
  -webkit-transition: all 1.1s ease;
202
  -moz-transition: all 1.1s ease;
@@ -205,6 +291,7 @@
205
  transition: all 1.1s ease;
206
  max-width: 100%;
207
  }
 
208
  .rt-tpg-container .layout2 .rt-holder .rt-img-holder:hover img {
209
  -webkit-transform: scale(1.1);
210
  -moz-transform: scale(1.1);
@@ -212,6 +299,10 @@
212
  -o-transform: scale(1.1);
213
  transform: scale(1.1);
214
  }
 
 
 
 
215
  .rt-tpg-container .layout2 .rt-holder .rt-detail h2,
216
  .rt-tpg-container .layout2 .rt-holder .rt-detail h3,
217
  .rt-tpg-container .layout2 .rt-holder .rt-detail h4 {
@@ -221,10 +312,12 @@
221
  font-weight: 400;
222
  line-height: 1.25;
223
  }
 
224
  .rt-tpg-container .layout2 .rt-holder .rt-img-holder {
225
  position: relative;
226
  overflow: hidden;
227
  }
 
228
  .rt-tpg-container .layout2 .rt-holder .rt-img-holder .overlay {
229
  width: 100%;
230
  height: 100%;
@@ -240,11 +333,13 @@
240
  transition: all 0.3s ease-out 0s;
241
  text-align: center;
242
  }
 
243
  .rt-tpg-container .layout2 .rt-holder .rt-img-holder .overlay .link-holder {
244
  left: 0;
245
  position: absolute;
246
  right: 0;
247
  }
 
248
  .rt-tpg-container .layout2 .rt-holder .rt-img-holder .overlay .link-holder .view-details {
249
  border: 1px solid #fff;
250
  color: #fff;
@@ -258,18 +353,22 @@
258
  -moz-border-radius: 50%;
259
  -webkit-border-radius: 50%;
260
  }
 
261
  .rt-tpg-container .layout2 .rt-img-holder .overlay .link-holder i {
262
  color: #fff;
263
  text-align: center;
264
  padding: 8px 14px;
265
  }
 
266
  .rt-tpg-container .layout2 .rt-holder .rt-img-holder:hover .overlay {
267
  opacity: 1;
268
  }
 
269
  .rt-tpg-container .layout2 .rt-holder .rt-detail .read-more {
270
  display: block;
271
  text-align: right;
272
  }
 
273
  .rt-tpg-container .layout2 .rt-holder .rt-detail .read-more a {
274
  display: inline-block;
275
  padding: 6px 12px;
@@ -287,9 +386,14 @@
287
  .rt-tpg-container .layout3 .rt-holder {
288
  padding-bottom: 15px;
289
  }
 
290
  .rt-tpg-container .layout3 .rt-holder .rt-detail p {
291
  line-height: 24px;
292
  }
 
 
 
 
293
  .rt-tpg-container .layout3 .rt-holder .rt-detail h2,
294
  .rt-tpg-container .layout3 .rt-holder .rt-detail h3,
295
  .rt-tpg-container .layout3 .rt-holder .rt-detail h4 {
@@ -299,10 +403,12 @@
299
  font-weight: 400;
300
  line-height: 1.25;
301
  }
 
302
  .rt-tpg-container .layout3 .rt-holder .rt-img-holder {
303
  position: relative;
304
  overflow: hidden;
305
  }
 
306
  .rt-tpg-container .layout3 .rt-holder .rt-img-holder .overlay {
307
  width: 100%;
308
  height: 100%;
@@ -318,11 +424,13 @@
318
  transition: all 0.3s ease-out 0s;
319
  text-align: center;
320
  }
 
321
  .rt-tpg-container .layout3 .rt-holder .rt-img-holder .overlay .link-holder {
322
  left: 0;
323
  position: absolute;
324
  right: 0;
325
  }
 
326
  .rt-tpg-container .layout3 .rt-holder .rt-img-holder .overlay .link-holder .view-details {
327
  border: 1px solid #fff;
328
  color: #fff;
@@ -336,18 +444,22 @@
336
  -moz-border-radius: 50%;
337
  -webkit-border-radius: 50%;
338
  }
 
339
  .rt-tpg-container .layout3 .rt-img-holder .overlay .link-holder i {
340
  color: #fff;
341
  text-align: center;
342
  padding: 8px 14px;
343
  }
 
344
  .rt-tpg-container .layout3 .rt-holder .rt-img-holder:hover .overlay {
345
  opacity: 1;
346
  }
 
347
  .rt-tpg-container .layout3 .rt-holder .rt-detail .read-more {
348
  display: block;
349
  text-align: right;
350
  }
 
351
  .rt-tpg-container .layout3 .rt-holder .rt-detail .read-more a {
352
  padding: 6px 12px;
353
  border-radius: 5px;
@@ -356,7 +468,8 @@
356
  background: #337ab7;
357
  font-size: 15px;
358
  }
359
- .rt-tpg-container .layout3 .rt-holder .rt-img-holder > a img.rounded,
 
360
  .layout3 .rt-holder .rt-img-holder .overlay {
361
  border-radius: 50%;
362
  }
@@ -366,8 +479,9 @@
366
  /**********************************************************************/
367
 
368
  .rt-tpg-container .isotope1 .rt-holder {
369
- padding-bottom: 30px;
370
  }
 
371
  .rt-tpg-container .isotope1 .rt-holder .rt-img-holder img {
372
  -webkit-transition: all 1.1s ease;
373
  -moz-transition: all 1.1s ease;
@@ -376,6 +490,7 @@
376
  transition: all 1.1s ease;
377
  max-width: 100%;
378
  }
 
379
  .rt-tpg-container .isotope1 .rt-holder .rt-img-holder:hover img {
380
  -webkit-transform: scale(1.1);
381
  -moz-transform: scale(1.1);
@@ -383,10 +498,12 @@
383
  -o-transform: scale(1.1);
384
  transform: scale(1.1);
385
  }
 
386
  .rt-tpg-container .isotope1 .rt-holder .rt-img-holder {
387
  position: relative;
388
  overflow: hidden;
389
  }
 
390
  .rt-tpg-container .isotope1 .rt-holder .rt-img-holder .overlay {
391
  width: 100%;
392
  height: 100%;
@@ -402,20 +519,28 @@
402
  transition: all 0.3s ease-out 0s;
403
  text-align: center;
404
  }
 
405
  .rt-tpg-container .isotope1 .rt-holder .rt-img-holder .overlay .view-details {
406
  display: inline-block;
407
  font-size: 20px;
408
  }
 
409
  .rt-tpg-container .isotope1 .rt-holder .rt-img-holder:hover .overlay {
410
  opacity: 1;
411
  }
 
412
  .rt-tpg-container .isotope1 .rt-holder .rt-img-holder .active {
413
  opacity: 1;
414
  }
 
415
  .rt-tpg-container .isotope1 .rt-holder .rt-detail {
416
  background: #fff;
417
  padding: 15px 0;
418
  }
 
 
 
 
419
  .rt-tpg-container .isotope1 .rt-holder .rt-detail h2,
420
  .rt-tpg-container .isotope1 .rt-holder .rt-detail h3,
421
  .rt-tpg-container .isotope1 .rt-holder .rt-detail h4 {
@@ -423,7 +548,9 @@
423
  margin: 0 0 14px;
424
  font-weight: 400;
425
  line-height: 1.25;
 
426
  }
 
427
  .rt-tpg-container .isotope1 .rt-holder .view-details {
428
  width: 36px;
429
  height: 36px;
@@ -433,11 +560,13 @@
433
  -moz-border-radius: 50%;
434
  -webkit-border-radius: 50%;
435
  }
 
436
  .rt-tpg-container .isotope1 .rt-holder .view-details i {
437
  color: #fff;
438
  text-align: center;
439
  padding: 8px 14px;
440
  }
 
441
  .rt-tpg-container .isotope1 .rt-holder .rt-detail .post-meta {
442
  text-align: right;
443
  }
@@ -448,7 +577,8 @@
448
  text-align: right;
449
  margin-top: 15px;
450
  }
451
- .rt-tpg-container .isotope1 .rt-holder .rt-detail .read-more a{
 
452
  padding: 6px 12px;
453
  border-radius: 5px;
454
  -moz-border-radius: 5px;
@@ -462,9 +592,11 @@
462
  text-align: center;
463
  margin: 15px 0;
464
  }
 
465
  .rt-tpg-container .rt-tpg-isotope-buttons .selected {
466
  background: #1e73be;
467
  }
 
468
  .rt-tpg-container .rt-tpg-isotope-buttons button {
469
  border: none;
470
  margin: 4px;
@@ -483,6 +615,7 @@
483
  text-align: center;
484
  margin: 30px;
485
  }
 
486
  .rt-pagination .pagination {
487
  display: inline-block;
488
  padding-left: 0;
@@ -491,15 +624,19 @@
491
  background: transparent;
492
  border-top: 0;
493
  }
 
494
  .entry-content .rt-pagination a {
495
  box-shadow: none;
496
  }
 
497
  .rt-pagination .pagination:before, .rt-pagination .pagination:after {
498
  content: none;
499
  }
 
500
  .rt-pagination .pagination > li {
501
  display: inline;
502
  }
 
503
  .rt-pagination .pagination > li > a,
504
  .rt-pagination .pagination > li > span {
505
  position: relative;
@@ -519,11 +656,13 @@
519
  border-bottom-left-radius: 4px;
520
  border-top-left-radius: 4px;
521
  }
 
522
  .rt-pagination .pagination > li:last-child > a,
523
  .rt-pagination .pagination > li:last-child > span {
524
  border-bottom-right-radius: 4px;
525
  border-top-right-radius: 4px;
526
  }
 
527
  .rt-pagination .pagination > li > a:hover,
528
  .rt-pagination .pagination > li > span:hover,
529
  .rt-pagination .pagination > li > a:focus,
@@ -546,6 +685,7 @@
546
  border-color: #337ab7;
547
  cursor: default;
548
  }
 
549
  .rt-pagination .pagination > .disabled > span,
550
  .rt-pagination .pagination > .disabled > span:hover,
551
  .rt-pagination .pagination > .disabled > span:focus,
@@ -557,33 +697,39 @@
557
  border-color: #dddddd;
558
  cursor: not-allowed;
559
  }
 
560
  .rt-pagination .pagination-lg > li > a,
561
  .rt-pagination .pagination-lg > li > span {
562
  padding: 10px 16px;
563
  font-size: 18px;
564
  line-height: 1.3333333;
565
  }
 
566
  .rt-pagination .pagination-lg > li:first-child > a,
567
  .rt-pagination .pagination-lg > li:first-child > span {
568
  border-bottom-left-radius: 6px;
569
  border-top-left-radius: 6px;
570
  }
 
571
  .rt-pagination .pagination-lg > li:last-child > a,
572
  .rt-pagination .pagination-lg > li:last-child > span {
573
  border-bottom-right-radius: 6px;
574
  border-top-right-radius: 6px;
575
  }
 
576
  .rt-pagination .pagination-sm > li > a,
577
  .rt-pagination .pagination-sm > li > span {
578
  padding: 5px 10px;
579
  font-size: 12px;
580
  line-height: 1.5;
581
  }
 
582
  .rt-pagination .pagination-sm > li:first-child > a,
583
  .rt-pagination .pagination-sm > li:first-child > span {
584
  border-bottom-left-radius: 3px;
585
  border-top-left-radius: 3px;
586
  }
 
587
  .rt-pagination .pagination-sm > li:last-child > a,
588
  .rt-pagination .pagination-sm > li:last-child > span {
589
  border-bottom-right-radius: 3px;
@@ -630,22 +776,188 @@
630
  }
631
 
632
  @media (min-width: 768px) {
633
- .rt-col-sm-24,.rt-col-sm-1, .rt-col-sm-2, .rt-col-sm-3, .rt-col-sm-4, .rt-col-sm-5, .rt-col-sm-6, .rt-col-sm-7, .rt-col-sm-8, .rt-col-sm-9, .rt-col-sm-10, .rt-col-sm-11, .rt-col-sm-12 {
634
  float: left;
635
  }
636
- .rt-col-sm-24{ width: 20%; }.rt-col-sm-12 { width: 100%; } .rt-col-sm-11 { width: 91.66666667%; } .rt-col-sm-10 { width: 83.33333333%; } .rt-col-sm-9 { width: 75%; } .rt-col-sm-8 { width: 66.66666667%; } .rt-col-sm-7 { width: 58.33333333%; } .rt-col-sm-6 { width: 50%; } .rt-col-sm-5 { width: 41.66666667%; } .rt-col-sm-4 { width: 33.33333333%; } .rt-col-sm-3 { width: 25%; } .rt-col-sm-2 { width: 16.66666667%; } .rt-col-sm-1 { width: 8.33333333%; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
637
  }
638
 
639
  @media (min-width: 992px) {
640
- .rt-col-md-24,.rt-col-md-1, .rt-col-md-2, .rt-col-md-3, .rt-col-md-4, .rt-col-md-5, .rt-col-md-6, .rt-col-md-7, .rt-col-md-8, .rt-col-md-9, .rt-col-md-10, .rt-col-md-11, .rt-col-md-12 {
641
  float: left;
642
  }
643
- .rt-col-md-24 { width: 20%; }.rt-col-md-12 { width: 100%; } .rt-col-md-11 { width: 91.66666667%; } .rt-col-md-10 { width: 83.33333333%; } .rt-col-md-9 { width: 75%; } .rt-col-md-8 { width: 66.66666667%; } .rt-col-md-7 { width: 58.33333333%; } .rt-col-md-6 { width: 50%; } .rt-col-md-5 { width: 41.66666667%; } .rt-col-md-4 { width: 33.33333333%; } .rt-col-md-3 { width: 25%; } .rt-col-md-2 { width: 16.66666667%; } .rt-col-md-1 { width: 8.33333333%; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
644
  }
645
 
646
  @media (min-width: 1200px) {
647
- .rt-col-lg-24,.rt-col-lg-1, .rt-col-lg-2, .rt-col-lg-3, .rt-col-lg-4, .rt-col-lg-5, .rt-col-lg-6, .rt-col-lg-7, .rt-col-lg-8, .rt-col-lg-9, .rt-col-lg-10, .rt-col-lg-11, .rt-col-lg-12 {
648
  float: left;
649
  }
650
- .rt-col-lg-24 { width: 20%; }.rt-col-lg-12 { width: 100%; } .rt-col-lg-11 { width: 91.66666667%; } .rt-col-lg-10 { width: 83.33333333%; } .rt-col-lg-9 { width: 75%; } .rt-col-lg-8 { width: 66.66666667%; } .rt-col-lg-7 { width: 58.33333333%; } .rt-col-lg-6 { width: 50%; } .rt-col-lg-5 { width: 41.66666667%; } .rt-col-lg-4 { width: 33.33333333%; } .rt-col-lg-3 { width: 25%; } .rt-col-lg-2 { width: 16.66666667%; } .rt-col-lg-1 { width: 8.33333333%; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
651
  }
6
  -moz-box-sizing: border-box;
7
  box-sizing: border-box;
8
  }
9
+
10
  .rt-tpg-container *:before,
11
  .rt-tpg-container *:after {
12
  -webkit-box-sizing: border-box;
13
  -moz-box-sizing: border-box;
14
  box-sizing: border-box;
15
  }
16
+
17
  .container {
18
  margin-right: auto;
19
  margin-left: auto;
20
  padding-left: 15px;
21
  padding-right: 15px;
22
  }
23
+
24
  .container-fluid {
25
  margin-right: auto;
26
  margin-left: auto;
27
  padding-left: 15px;
28
  padding-right: 15px;
29
  }
30
+
31
  .rt-tpg-container ul {
32
  margin: 0;
33
  }
34
+
35
  .rt-tpg-container i {
36
  margin-right: 5px;
37
  }
38
+
39
  .clearfix:before, .clearfix:after, .container:before, .container:after, .container-fluid:before, .container-fluid:after, .row:before, .row:after {
40
  content: " ";
41
  display: table;
42
  }
43
+
44
  .clearfix:after, .container:after, .container-fluid:after, .row:after {
45
  clear: both;
46
  }
47
+
48
  .row {
49
  margin-left: -15px;
50
  margin-right: -15px;
51
  }
52
+
53
  .rt-col-xs-24,
54
  .rt-col-sm-24, .rt-col-md-24, .rt-col-lg-24,
55
  .rt-col-xs-1,
59
  padding-left: 15px;
60
  padding-right: 15px;
61
  }
62
+
63
+ .rt-col-xs-24, .rt-col-xs-1, .rt-col-xs-2, .rt-col-xs-3, .rt-col-xs-4, .rt-col-xs-5, .rt-col-xs-6, .rt-col-xs-7, .rt-col-xs-8, .rt-col-xs-9, .rt-col-xs-10, .rt-col-xs-11, .rt-col-xs-12 {
64
  float: left;
65
  }
66
+
67
+ .rt-col-xs-24 {
68
+ width: 20%;
69
+ }
70
+
71
+ .rt-col-xs-12 {
72
+ width: 100%;
73
+ }
74
+
75
+ .rt-col-xs-11 {
76
+ width: 91.66666667%;
77
  }
78
+
79
+ .rt-col-xs-10 {
80
+ width: 83.33333333%;
81
+ }
82
+
83
+ .rt-col-xs-9 {
84
+ width: 75%;
85
+ }
86
+
87
+ .rt-col-xs-8 {
88
+ width: 66.66666667%;
89
+ }
90
+
91
+ .rt-col-xs-7 {
92
+ width: 58.33333333%;
93
+ }
94
+
95
+ .rt-col-xs-6 {
96
+ width: 50%;
97
+ }
98
+
99
+ .rt-col-xs-5 {
100
+ width: 41.66666667%;
101
+ }
102
+
103
+ .rt-col-xs-4 {
104
+ width: 33.33333333%;
105
+ }
106
+
107
+ .rt-col-xs-3 {
108
+ width: 25%;
109
+ }
110
+
111
+ .rt-col-xs-2 {
112
+ width: 16.66666667%;
113
+ }
114
+
115
+ .rt-col-xs-1 {
116
+ width: 8.33333333%;
117
+ }
118
+
119
+ .img-responsive {
120
+ max-width: 100%;
121
+ display: block;
122
+ }
123
+
124
+ .rt-tpg-container .rt-equal-height {
125
+ margin-bottom: 15px;
126
  }
127
 
128
  /**********************************************************************/
137
  content: "";
138
  display: block;
139
  }
140
+
141
  .post-meta-user {
142
+ padding: 0 0 10px;
143
  font-size: 90%;
144
  }
145
+
146
  .post-meta-tags {
147
  padding: 0 0 5px 0;
148
  font-size: 90%;
149
  }
150
+
151
  .post-meta-user span, .post-meta-tags span {
152
  display: inline-block;
153
  padding-right: 5px;
154
  }
155
+
156
  .post-meta-user span.comment-link {
157
  text-align: right;
158
  float: right;
159
  padding-right: 0;
160
  }
161
+
162
  .post-meta-user span.post-tags-links {
163
  padding-right: 0;
164
  }
170
  .rt-tpg-container .layout1 .rt-holder {
171
  padding-bottom: 15px;
172
  }
173
+
174
  .rt-tpg-container .layout1 .rt-holder .rt-img-holder {
175
  position: relative;
176
  overflow: hidden;
177
  }
178
+
179
  .rt-tpg-container .layout1 .rt-holder .rt-img-holder img {
180
  -webkit-transition: all 1.1s ease;
181
  -moz-transition: all 1.1s ease;
184
  transition: all 1.1s ease;
185
  max-width: 100%;
186
  }
187
+
188
  .rt-tpg-container .layout1 .rt-holder .rt-img-holder:hover img {
189
  -webkit-transform: scale(1.1);
190
  -moz-transform: scale(1.1);
192
  -o-transform: scale(1.1);
193
  transform: scale(1.1);
194
  }
195
+
196
  .rt-tpg-container .layout1 .rt-holder .rt-img-holder .overlay {
197
  width: 100%;
198
  height: 100%;
208
  transition: all 0.3s ease-out 0s;
209
  text-align: center;
210
  }
211
+
212
  .rt-tpg-container .layout1 .rt-holder .rt-img-holder .overlay .view-details {
213
  display: inline-block;
214
  font-size: 20px;
215
  }
216
+
217
  .rt-tpg-container .layout1 .rt-holder .rt-img-holder:hover .overlay {
218
  opacity: 1;
219
  }
220
+
221
  .rt-tpg-container .layout1 .rt-holder .rt-img-holder .active {
222
  opacity: 1;
223
  }
224
+
225
  .rt-tpg-container .layout1 .rt-holder .rt-detail {
226
  background: #fff;
227
  padding: 15px 0;
228
  }
229
+
230
+ #poststuff .rt-tpg-container .layout1 .rt-holder .rt-detail h2,
231
+ #poststuff .rt-tpg-container .layout1 .rt-holder .rt-detail h3,
232
+ #poststuff .rt-tpg-container .layout1 .rt-holder .rt-detail h4 ,
233
  .rt-tpg-container .layout1 .rt-holder .rt-detail h2,
234
  .rt-tpg-container .layout1 .rt-holder .rt-detail h3,
235
  .rt-tpg-container .layout1 .rt-holder .rt-detail h4 {
238
  font-size: 24px;
239
  line-height: 1.25;
240
  }
241
+
242
  .rt-tpg-container .layout1 .rt-holder .view-details {
243
  width: 36px;
244
  height: 36px;
248
  -moz-border-radius: 50%;
249
  -webkit-border-radius: 50%;
250
  }
251
+
252
  .rt-tpg-container .layout1 .rt-holder .view-details i {
253
  color: #fff;
254
  text-align: center;
255
  padding: 8px 14px;
256
  }
257
+
258
  .rt-tpg-container .layout1 .rt-holder .rt-detail .post-meta {
259
  text-align: right;
260
  margin-top: 10px;
261
  }
262
+
263
  .rt-tpg-container .layout1 .rt-holder .rt-detail .read-more {
264
  display: block;
265
  text-align: right;
266
  }
267
+
268
  .rt-tpg-container .layout1 .rt-holder .rt-detail .read-more a {
269
  padding: 6px 12px;
270
  border-radius: 5px;
282
  .rt-tpg-container .layout2 .rt-holder {
283
  padding-bottom: 15px;
284
  }
285
+
286
  .rt-tpg-container .layout2 .rt-holder .rt-img-holder img {
287
  -webkit-transition: all 1.1s ease;
288
  -moz-transition: all 1.1s ease;
291
  transition: all 1.1s ease;
292
  max-width: 100%;
293
  }
294
+
295
  .rt-tpg-container .layout2 .rt-holder .rt-img-holder:hover img {
296
  -webkit-transform: scale(1.1);
297
  -moz-transform: scale(1.1);
299
  -o-transform: scale(1.1);
300
  transform: scale(1.1);
301
  }
302
+
303
+ #poststuff .rt-tpg-container .layout2 .rt-holder .rt-detail h2,
304
+ #poststuff .rt-tpg-container .layout2 .rt-holder .rt-detail h3,
305
+ #poststuff .rt-tpg-container .layout2 .rt-holder .rt-detail h4,
306
  .rt-tpg-container .layout2 .rt-holder .rt-detail h2,
307
  .rt-tpg-container .layout2 .rt-holder .rt-detail h3,
308
  .rt-tpg-container .layout2 .rt-holder .rt-detail h4 {
312
  font-weight: 400;
313
  line-height: 1.25;
314
  }
315
+
316
  .rt-tpg-container .layout2 .rt-holder .rt-img-holder {
317
  position: relative;
318
  overflow: hidden;
319
  }
320
+
321
  .rt-tpg-container .layout2 .rt-holder .rt-img-holder .overlay {
322
  width: 100%;
323
  height: 100%;
333
  transition: all 0.3s ease-out 0s;
334
  text-align: center;
335
  }
336
+
337
  .rt-tpg-container .layout2 .rt-holder .rt-img-holder .overlay .link-holder {
338
  left: 0;
339
  position: absolute;
340
  right: 0;
341
  }
342
+
343
  .rt-tpg-container .layout2 .rt-holder .rt-img-holder .overlay .link-holder .view-details {
344
  border: 1px solid #fff;
345
  color: #fff;
353
  -moz-border-radius: 50%;
354
  -webkit-border-radius: 50%;
355
  }
356
+
357
  .rt-tpg-container .layout2 .rt-img-holder .overlay .link-holder i {
358
  color: #fff;
359
  text-align: center;
360
  padding: 8px 14px;
361
  }
362
+
363
  .rt-tpg-container .layout2 .rt-holder .rt-img-holder:hover .overlay {
364
  opacity: 1;
365
  }
366
+
367
  .rt-tpg-container .layout2 .rt-holder .rt-detail .read-more {
368
  display: block;
369
  text-align: right;
370
  }
371
+
372
  .rt-tpg-container .layout2 .rt-holder .rt-detail .read-more a {
373
  display: inline-block;
374
  padding: 6px 12px;
386
  .rt-tpg-container .layout3 .rt-holder {
387
  padding-bottom: 15px;
388
  }
389
+
390
  .rt-tpg-container .layout3 .rt-holder .rt-detail p {
391
  line-height: 24px;
392
  }
393
+
394
+ #poststuff .rt-tpg-container .layout3 .rt-holder .rt-detail h2,
395
+ #poststuff .rt-tpg-container .layout3 .rt-holder .rt-detail h3,
396
+ #poststuff .rt-tpg-container .layout3 .rt-holder .rt-detail h4,
397
  .rt-tpg-container .layout3 .rt-holder .rt-detail h2,
398
  .rt-tpg-container .layout3 .rt-holder .rt-detail h3,
399
  .rt-tpg-container .layout3 .rt-holder .rt-detail h4 {
403
  font-weight: 400;
404
  line-height: 1.25;
405
  }
406
+
407
  .rt-tpg-container .layout3 .rt-holder .rt-img-holder {
408
  position: relative;
409
  overflow: hidden;
410
  }
411
+
412
  .rt-tpg-container .layout3 .rt-holder .rt-img-holder .overlay {
413
  width: 100%;
414
  height: 100%;
424
  transition: all 0.3s ease-out 0s;
425
  text-align: center;
426
  }
427
+
428
  .rt-tpg-container .layout3 .rt-holder .rt-img-holder .overlay .link-holder {
429
  left: 0;
430
  position: absolute;
431
  right: 0;
432
  }
433
+
434
  .rt-tpg-container .layout3 .rt-holder .rt-img-holder .overlay .link-holder .view-details {
435
  border: 1px solid #fff;
436
  color: #fff;
444
  -moz-border-radius: 50%;
445
  -webkit-border-radius: 50%;
446
  }
447
+
448
  .rt-tpg-container .layout3 .rt-img-holder .overlay .link-holder i {
449
  color: #fff;
450
  text-align: center;
451
  padding: 8px 14px;
452
  }
453
+
454
  .rt-tpg-container .layout3 .rt-holder .rt-img-holder:hover .overlay {
455
  opacity: 1;
456
  }
457
+
458
  .rt-tpg-container .layout3 .rt-holder .rt-detail .read-more {
459
  display: block;
460
  text-align: right;
461
  }
462
+
463
  .rt-tpg-container .layout3 .rt-holder .rt-detail .read-more a {
464
  padding: 6px 12px;
465
  border-radius: 5px;
468
  background: #337ab7;
469
  font-size: 15px;
470
  }
471
+
472
+ .rt-tpg-container .layout3 .rt-holder .rt-img-holder > a img.rounded,
473
  .layout3 .rt-holder .rt-img-holder .overlay {
474
  border-radius: 50%;
475
  }
479
  /**********************************************************************/
480
 
481
  .rt-tpg-container .isotope1 .rt-holder {
482
+ padding-bottom: 15px;
483
  }
484
+
485
  .rt-tpg-container .isotope1 .rt-holder .rt-img-holder img {
486
  -webkit-transition: all 1.1s ease;
487
  -moz-transition: all 1.1s ease;
490
  transition: all 1.1s ease;
491
  max-width: 100%;
492
  }
493
+
494
  .rt-tpg-container .isotope1 .rt-holder .rt-img-holder:hover img {
495
  -webkit-transform: scale(1.1);
496
  -moz-transform: scale(1.1);
498
  -o-transform: scale(1.1);
499
  transform: scale(1.1);
500
  }
501
+
502
  .rt-tpg-container .isotope1 .rt-holder .rt-img-holder {
503
  position: relative;
504
  overflow: hidden;
505
  }
506
+
507
  .rt-tpg-container .isotope1 .rt-holder .rt-img-holder .overlay {
508
  width: 100%;
509
  height: 100%;
519
  transition: all 0.3s ease-out 0s;
520
  text-align: center;
521
  }
522
+
523
  .rt-tpg-container .isotope1 .rt-holder .rt-img-holder .overlay .view-details {
524
  display: inline-block;
525
  font-size: 20px;
526
  }
527
+
528
  .rt-tpg-container .isotope1 .rt-holder .rt-img-holder:hover .overlay {
529
  opacity: 1;
530
  }
531
+
532
  .rt-tpg-container .isotope1 .rt-holder .rt-img-holder .active {
533
  opacity: 1;
534
  }
535
+
536
  .rt-tpg-container .isotope1 .rt-holder .rt-detail {
537
  background: #fff;
538
  padding: 15px 0;
539
  }
540
+
541
+ #poststuff .rt-tpg-container .isotope1 .rt-holder .rt-detail h2,
542
+ #poststuff .rt-tpg-container .isotope1 .rt-holder .rt-detail h3,
543
+ #poststuff .rt-tpg-container .isotope1 .rt-holder .rt-detail h4,
544
  .rt-tpg-container .isotope1 .rt-holder .rt-detail h2,
545
  .rt-tpg-container .isotope1 .rt-holder .rt-detail h3,
546
  .rt-tpg-container .isotope1 .rt-holder .rt-detail h4 {
548
  margin: 0 0 14px;
549
  font-weight: 400;
550
  line-height: 1.25;
551
+ padding: 0;
552
  }
553
+
554
  .rt-tpg-container .isotope1 .rt-holder .view-details {
555
  width: 36px;
556
  height: 36px;
560
  -moz-border-radius: 50%;
561
  -webkit-border-radius: 50%;
562
  }
563
+
564
  .rt-tpg-container .isotope1 .rt-holder .view-details i {
565
  color: #fff;
566
  text-align: center;
567
  padding: 8px 14px;
568
  }
569
+
570
  .rt-tpg-container .isotope1 .rt-holder .rt-detail .post-meta {
571
  text-align: right;
572
  }
577
  text-align: right;
578
  margin-top: 15px;
579
  }
580
+
581
+ .rt-tpg-container .isotope1 .rt-holder .rt-detail .read-more a {
582
  padding: 6px 12px;
583
  border-radius: 5px;
584
  -moz-border-radius: 5px;
592
  text-align: center;
593
  margin: 15px 0;
594
  }
595
+
596
  .rt-tpg-container .rt-tpg-isotope-buttons .selected {
597
  background: #1e73be;
598
  }
599
+
600
  .rt-tpg-container .rt-tpg-isotope-buttons button {
601
  border: none;
602
  margin: 4px;
615
  text-align: center;
616
  margin: 30px;
617
  }
618
+
619
  .rt-pagination .pagination {
620
  display: inline-block;
621
  padding-left: 0;
624
  background: transparent;
625
  border-top: 0;
626
  }
627
+
628
  .entry-content .rt-pagination a {
629
  box-shadow: none;
630
  }
631
+
632
  .rt-pagination .pagination:before, .rt-pagination .pagination:after {
633
  content: none;
634
  }
635
+
636
  .rt-pagination .pagination > li {
637
  display: inline;
638
  }
639
+
640
  .rt-pagination .pagination > li > a,
641
  .rt-pagination .pagination > li > span {
642
  position: relative;
656
  border-bottom-left-radius: 4px;
657
  border-top-left-radius: 4px;
658
  }
659
+
660
  .rt-pagination .pagination > li:last-child > a,
661
  .rt-pagination .pagination > li:last-child > span {
662
  border-bottom-right-radius: 4px;
663
  border-top-right-radius: 4px;
664
  }
665
+
666
  .rt-pagination .pagination > li > a:hover,
667
  .rt-pagination .pagination > li > span:hover,
668
  .rt-pagination .pagination > li > a:focus,
685
  border-color: #337ab7;
686
  cursor: default;
687
  }
688
+
689
  .rt-pagination .pagination > .disabled > span,
690
  .rt-pagination .pagination > .disabled > span:hover,
691
  .rt-pagination .pagination > .disabled > span:focus,
697
  border-color: #dddddd;
698
  cursor: not-allowed;
699
  }
700
+
701
  .rt-pagination .pagination-lg > li > a,
702
  .rt-pagination .pagination-lg > li > span {
703
  padding: 10px 16px;
704
  font-size: 18px;
705
  line-height: 1.3333333;
706
  }
707
+
708
  .rt-pagination .pagination-lg > li:first-child > a,
709
  .rt-pagination .pagination-lg > li:first-child > span {
710
  border-bottom-left-radius: 6px;
711
  border-top-left-radius: 6px;
712
  }
713
+
714
  .rt-pagination .pagination-lg > li:last-child > a,
715
  .rt-pagination .pagination-lg > li:last-child > span {
716
  border-bottom-right-radius: 6px;
717
  border-top-right-radius: 6px;
718
  }
719
+
720
  .rt-pagination .pagination-sm > li > a,
721
  .rt-pagination .pagination-sm > li > span {
722
  padding: 5px 10px;
723
  font-size: 12px;
724
  line-height: 1.5;
725
  }
726
+
727
  .rt-pagination .pagination-sm > li:first-child > a,
728
  .rt-pagination .pagination-sm > li:first-child > span {
729
  border-bottom-left-radius: 3px;
730
  border-top-left-radius: 3px;
731
  }
732
+
733
  .rt-pagination .pagination-sm > li:last-child > a,
734
  .rt-pagination .pagination-sm > li:last-child > span {
735
  border-bottom-right-radius: 3px;
776
  }
777
 
778
  @media (min-width: 768px) {
779
+ .rt-col-sm-24, .rt-col-sm-1, .rt-col-sm-2, .rt-col-sm-3, .rt-col-sm-4, .rt-col-sm-5, .rt-col-sm-6, .rt-col-sm-7, .rt-col-sm-8, .rt-col-sm-9, .rt-col-sm-10, .rt-col-sm-11, .rt-col-sm-12 {
780
  float: left;
781
  }
782
+
783
+ .rt-col-sm-24 {
784
+ width: 20%;
785
+ }
786
+
787
+ .rt-col-sm-12 {
788
+ width: 100%;
789
+ }
790
+
791
+ .rt-col-sm-11 {
792
+ width: 91.66666667%;
793
+ }
794
+
795
+ .rt-col-sm-10 {
796
+ width: 83.33333333%;
797
+ }
798
+
799
+ .rt-col-sm-9 {
800
+ width: 75%;
801
+ }
802
+
803
+ .rt-col-sm-8 {
804
+ width: 66.66666667%;
805
+ }
806
+
807
+ .rt-col-sm-7 {
808
+ width: 58.33333333%;
809
+ }
810
+
811
+ .rt-col-sm-6 {
812
+ width: 50%;
813
+ }
814
+
815
+ .rt-col-sm-5 {
816
+ width: 41.66666667%;
817
+ }
818
+
819
+ .rt-col-sm-4 {
820
+ width: 33.33333333%;
821
+ }
822
+
823
+ .rt-col-sm-3 {
824
+ width: 25%;
825
+ }
826
+
827
+ .rt-col-sm-2 {
828
+ width: 16.66666667%;
829
+ }
830
+
831
+ .rt-col-sm-1 {
832
+ width: 8.33333333%;
833
+ }
834
  }
835
 
836
  @media (min-width: 992px) {
837
+ .rt-col-md-24, .rt-col-md-1, .rt-col-md-2, .rt-col-md-3, .rt-col-md-4, .rt-col-md-5, .rt-col-md-6, .rt-col-md-7, .rt-col-md-8, .rt-col-md-9, .rt-col-md-10, .rt-col-md-11, .rt-col-md-12 {
838
  float: left;
839
  }
840
+
841
+ .rt-col-md-24 {
842
+ width: 20%;
843
+ }
844
+
845
+ .rt-col-md-12 {
846
+ width: 100%;
847
+ }
848
+
849
+ .rt-col-md-11 {
850
+ width: 91.66666667%;
851
+ }
852
+
853
+ .rt-col-md-10 {
854
+ width: 83.33333333%;
855
+ }
856
+
857
+ .rt-col-md-9 {
858
+ width: 75%;
859
+ }
860
+
861
+ .rt-col-md-8 {
862
+ width: 66.66666667%;
863
+ }
864
+
865
+ .rt-col-md-7 {
866
+ width: 58.33333333%;
867
+ }
868
+
869
+ .rt-col-md-6 {
870
+ width: 50%;
871
+ }
872
+
873
+ .rt-col-md-5 {
874
+ width: 41.66666667%;
875
+ }
876
+
877
+ .rt-col-md-4 {
878
+ width: 33.33333333%;
879
+ }
880
+
881
+ .rt-col-md-3 {
882
+ width: 25%;
883
+ }
884
+
885
+ .rt-col-md-2 {
886
+ width: 16.66666667%;
887
+ }
888
+
889
+ .rt-col-md-1 {
890
+ width: 8.33333333%;
891
+ }
892
  }
893
 
894
  @media (min-width: 1200px) {
895
+ .rt-col-lg-24, .rt-col-lg-1, .rt-col-lg-2, .rt-col-lg-3, .rt-col-lg-4, .rt-col-lg-5, .rt-col-lg-6, .rt-col-lg-7, .rt-col-lg-8, .rt-col-lg-9, .rt-col-lg-10, .rt-col-lg-11, .rt-col-lg-12 {
896
  float: left;
897
  }
898
+
899
+ .rt-col-lg-24 {
900
+ width: 20%;
901
+ }
902
+
903
+ .rt-col-lg-12 {
904
+ width: 100%;
905
+ }
906
+
907
+ .rt-col-lg-11 {
908
+ width: 91.66666667%;
909
+ }
910
+
911
+ .rt-col-lg-10 {
912
+ width: 83.33333333%;
913
+ }
914
+
915
+ .rt-col-lg-9 {
916
+ width: 75%;
917
+ }
918
+
919
+ .rt-col-lg-8 {
920
+ width: 66.66666667%;
921
+ }
922
+
923
+ .rt-col-lg-7 {
924
+ width: 58.33333333%;
925
+ }
926
+
927
+ .rt-col-lg-6 {
928
+ width: 50%;
929
+ }
930
+
931
+ .rt-col-lg-5 {
932
+ width: 41.66666667%;
933
+ }
934
+
935
+ .rt-col-lg-4 {
936
+ width: 33.33333333%;
937
+ }
938
+
939
+ .rt-col-lg-3 {
940
+ width: 25%;
941
+ }
942
+
943
+ .rt-col-lg-2 {
944
+ width: 16.66666667%;
945
+ }
946
+
947
+ .rt-col-lg-1 {
948
+ width: 8.33333333%;
949
+ }
950
+ }
951
+
952
+ /* admin preview */
953
+ #tpg-preview-container .rt-tpg-container .rt-tpg-isotope-buttons button {
954
+ line-height: 1.25;
955
+ }
956
+
957
+ #tpg-preview-container .rt-tpg-container .rt-tpg-isotope-buttons .selected {
958
+ color: #ffffff;
959
+ }
960
+
961
+ #tpg-preview-container .rt-tpg-container a {
962
+ text-decoration: none;
963
  }
assets/js/admin.js CHANGED
@@ -1,53 +1,73 @@
1
- (function($){
2
  'use strict';
3
- if($('.rt-color').length) {
4
- $('.rt-color').wpColorPicker();
5
- }
6
- if($('#sc-tabs').length) {
7
  $('#sc-tabs').tabs();
8
  }
9
- if($.fn.select2) {
 
10
  $(".rt-select2").select2({dropdownAutoWidth: true});
11
  }
12
  var postType = jQuery("#rc-sc-post-type").val();
13
  rtTgpFilter();
14
  thpShowHideScMeta();
15
- $(document).on('change', '#post_filter input[type=checkbox]', function() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  var id = $(this).val();
17
- if(id == 'tpg_taxonomy'){
18
- if(this.checked){
19
  rtTPGTaxonomyListByPostType(postType, $(this));
20
- }else{
21
  jQuery('.rt-tpg-filter.taxonomy > .taxonomy-field').hide('slow').html('');
22
  jQuery('.rt-tpg-filter.taxonomy > .rt-tpg-filter-item .term-filter-holder').hide('slow').html('');
23
  jQuery('.rt-tpg-filter.taxonomy > .rt-tpg-filter-item .term-filter-item-relation').hide('slow');
24
  }
25
  }
26
- if(this.checked){
27
- $(".rt-tpg-filter."+id).show('slow');
28
- }else{
29
- $(".rt-tpg-filter."+id).hide('slow');
30
  }
31
 
32
  });
33
 
34
- $(document).on('change', '#post-taxonomy input[type=checkbox]', function() {
35
- thpShowHideScMeta();
36
- rtTPGTermListByTaxonomy( $(this) );
37
  });
38
 
39
- $(document).on('change', "#rt-tpg-pagination", function() {
40
- if(this.checked){
41
  jQuery(".field-holder.posts-per-page").show();
42
- }else{
43
  jQuery(".field-holder.posts-per-page").hide();
44
  }
45
  });
46
 
47
- $(document).on('change', "#rt-feature-image", function() {
48
- if(this.checked){
49
  jQuery(".field-holder.feature-image-options").hide();
50
- }else{
51
  jQuery(".field-holder.feature-image-options").show();
52
  }
53
  });
@@ -58,9 +78,9 @@
58
 
59
  $("#rc-sc-post-type").on("change", function (e) {
60
  postType = $(this).select2("val");
61
- if(postType){
62
  rtTPGIsotopeFilter($(this));
63
- $('#post_filter input[type=checkbox]').each(function(){
64
  $(this).prop('checked', false);
65
  });
66
  $(".rt-tpg-filter.taxonomy > .taxonomy-field").html('');
@@ -70,74 +90,126 @@
70
  }
71
  });
72
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73
  })(jQuery);
74
 
75
- function rtTPGTaxonomyListByPostType( postType, $this){
76
 
77
- var arg = "post_type="+postType;
78
- tpgAjaxCall( $this, 'rtTPGTaxonomyListByPostType', arg, function(data){
79
  //console.log(data);
80
- if(data.error){
81
  alert(data.msg);
82
- }else{
83
  jQuery('.rt-tpg-filter.taxonomy > .taxonomy-field').html(data.data).show('slow');
84
  }
85
  });
86
  }
87
 
88
- function rtTPGIsotopeFilter( $this ) {
89
- var arg = "post_type="+$this.val();
90
  var bindElement = $this;
91
  var target = jQuery('.field-holder.sc-isotope-filter .field > select');
92
- tpgAjaxCall( bindElement, 'rtTPGIsotopeFilter', arg, function(data){
93
- if(data.error){
94
  alert(data.msg);
95
- }else{
96
  target.html(data.data);
97
  tgpLiveReloadScript();
98
  }
99
  });
100
  }
101
 
102
- function rtTPGTermListByTaxonomy( $this ){
103
  var term = $this.val();
104
  var targetHolder = jQuery('.rt-tpg-filter.taxonomy').children('.rt-tpg-filter-item').children('.field-holder').children('.term-filter-holder');
105
- var target = targetHolder.children('.term-filter-item-container.'+term);
106
- if($this.is(':checked')){
107
- var arg = "taxonomy="+$this.val();
108
  var bindElement = $this;
109
- tpgAjaxCall( bindElement, 'rtTPGTermListByTaxonomy', arg, function(data){
110
  //console.log(data);
111
- if(data.error){
112
  alert(data.msg);
113
- }else{
114
  targetHolder.show();
115
  jQuery(data.data).prependTo(targetHolder).fadeIn('slow');
116
  tgpLiveReloadScript();
117
  }
118
  });
119
- }else{
120
  target.hide('slow').html('').remove();
121
  }
122
 
123
  var termLength = jQuery('input[name="tpg_taxonomy[]"]:checked').length;
124
- if(termLength > 1){
125
  jQuery('.field-holder.term-filter-item-relation ').show('slow');
126
- }else{
127
  jQuery('.field-holder.term-filter-item-relation ').hide('slow');
128
  }
129
 
130
  }
131
- function rtTPGSettings(e){
 
132
  jQuery('rt-response').hide();
133
- var arg = jQuery( e ).serialize();
134
  var bindElement = jQuery('.rtSaveButton');
135
- tpgAjaxCall( bindElement, 'rtTPGSettings', arg, function(data){
136
- if(data.error){
137
  jQuery('.rt-response').addClass('updated');
138
  jQuery('.rt-response').removeClass('error');
139
  jQuery('.rt-response').show('slow').text(data.msg);
140
- }else{
141
  jQuery('.rt-response').addClass('error');
142
  jQuery('.rt-response').show('slow').text(data.msg);
143
  }
@@ -146,77 +218,79 @@ function rtTPGSettings(e){
146
  }
147
 
148
 
149
- function tpgAjaxCall( element, action, arg, handle){
150
  var data;
151
- if(action) data = "action=" + action;
152
- if(arg) data = arg + "&action=" + action;
153
- if(arg && !action) data = arg;
154
 
155
  var n = data.search(rttpg.nonceID);
156
- if(n<0){
157
  data = data + "&rttpg_nonce=" + rttpg.nonce;
158
  }
159
  jQuery.ajax({
160
  type: "post",
161
  url: rttpg.ajaxurl,
162
  data: data,
163
- beforeSend: function() { jQuery("<span class='rt-loading'></span>").insertAfter(element); },
164
- success: function( data ){
 
 
165
  jQuery(".rt-loading").remove();
166
  handle(data);
167
  }
168
  });
169
  }
170
 
171
- function rtTgpFilter(){
172
- jQuery("#post_filter input[type=checkbox]:checked").each(function(){
173
- var id = jQuery(this).val();
174
- jQuery(".rt-tpg-filter."+id).show();
175
  });
176
 
177
- jQuery("#post-taxonomy input[type=checkbox]:checked").each(function(){
178
- var id = jQuery(this).val();
179
- jQuery(".filter-item."+id).show();
180
  });
181
 
182
  }
183
 
184
- function thpShowHideScMeta(){
185
 
186
  var layout = jQuery("#rt-tpg-sc-layout").val();
187
- if( layout == 'isotope1'){
188
  jQuery(".field-holder.pagination, .field-holder.posts-per-page").hide();
189
  jQuery(".field-holder.sc-isotope-filter").show();
190
- }else{
191
  jQuery(".field-holder.pagination").show();
192
  jQuery(".field-holder.sc-isotope-filter").hide();
193
  var pagination = jQuery("#rt-tpg-pagination").is(':checked');
194
- if(pagination){
195
  jQuery(".field-holder.posts-per-page").show();
196
- }else{
197
  jQuery(".field-holder.posts-per-page").hide();
198
  }
199
  }
200
- if(layout == 'layout2' || layout == 'layout3'){
201
  jQuery('.holder-layout2-image-column').show();
202
- }else{
203
  jQuery('.holder-layout2-image-column').hide();
204
  }
205
- if(jQuery("#post-taxonomy input[name='tpg_taxonomy[]']").is(":checked")){
206
  jQuery(".rt-tpg-filter-item.term-filter-item").show();
207
- }else{
208
  jQuery(".rt-tpg-filter-item.term-filter-item").hide();
209
  }
210
 
211
 
212
- if(jQuery("#rt-feature-image").is(':checked')){
213
  jQuery(".field-holder.feature-image-options").hide();
214
- }else{
215
  jQuery(".field-holder.feature-image-options").show();
216
  }
217
 
218
  }
219
 
220
- function tgpLiveReloadScript(){
221
- jQuery("select.rt-select2").select2({ dropdownAutoWidth : true });
222
  }
1
+ (function ($) {
2
  'use strict';
3
+
4
+ if ($('#sc-tabs').length && $.fn.tabs) {
 
 
5
  $('#sc-tabs').tabs();
6
  }
7
+
8
+ if ($.fn.select2) {
9
  $(".rt-select2").select2({dropdownAutoWidth: true});
10
  }
11
  var postType = jQuery("#rc-sc-post-type").val();
12
  rtTgpFilter();
13
  thpShowHideScMeta();
14
+ renderTpgPreview();
15
+ $("#rttpg_meta").on('change', 'select,input', function () {
16
+ renderTpgPreview();
17
+ });
18
+ $("#rttpg_meta").on("input propertychange", function () {
19
+ renderTpgPreview();
20
+ });
21
+ if ($("#rttpg_meta .rt-color").length && $.fn.wpColorPicker) {
22
+ var cOptions = {
23
+ defaultColor: false,
24
+ change: function (event, ui) {
25
+ renderTpgPreview();
26
+ },
27
+ clear: function () {
28
+ renderTpgPreview();
29
+ },
30
+ hide: true,
31
+ palettes: true
32
+ };
33
+ $("#rttpg_meta .rt-color").wpColorPicker(cOptions);
34
+ }
35
+ $(document).on('change', '#post_filter input[type=checkbox]', function () {
36
  var id = $(this).val();
37
+ if (id == 'tpg_taxonomy') {
38
+ if (this.checked) {
39
  rtTPGTaxonomyListByPostType(postType, $(this));
40
+ } else {
41
  jQuery('.rt-tpg-filter.taxonomy > .taxonomy-field').hide('slow').html('');
42
  jQuery('.rt-tpg-filter.taxonomy > .rt-tpg-filter-item .term-filter-holder').hide('slow').html('');
43
  jQuery('.rt-tpg-filter.taxonomy > .rt-tpg-filter-item .term-filter-item-relation').hide('slow');
44
  }
45
  }
46
+ if (this.checked) {
47
+ $(".rt-tpg-filter." + id).show('slow');
48
+ } else {
49
+ $(".rt-tpg-filter." + id).hide('slow');
50
  }
51
 
52
  });
53
 
54
+ $(document).on('change', '#post-taxonomy input[type=checkbox]', function () {
55
+ thpShowHideScMeta();
56
+ rtTPGTermListByTaxonomy($(this));
57
  });
58
 
59
+ $(document).on('change', "#rt-tpg-pagination", function () {
60
+ if (this.checked) {
61
  jQuery(".field-holder.posts-per-page").show();
62
+ } else {
63
  jQuery(".field-holder.posts-per-page").hide();
64
  }
65
  });
66
 
67
+ $(document).on('change', "#rt-feature-image", function () {
68
+ if (this.checked) {
69
  jQuery(".field-holder.feature-image-options").hide();
70
+ } else {
71
  jQuery(".field-holder.feature-image-options").show();
72
  }
73
  });
78
 
79
  $("#rc-sc-post-type").on("change", function (e) {
80
  postType = $(this).select2("val");
81
+ if (postType) {
82
  rtTPGIsotopeFilter($(this));
83
+ $('#post_filter input[type=checkbox]').each(function () {
84
  $(this).prop('checked', false);
85
  });
86
  $(".rt-tpg-filter.taxonomy > .taxonomy-field").html('');
90
  }
91
  });
92
 
93
+
94
+ function renderTpgPreview() {
95
+ if ($("#rttpg_meta").length) {
96
+ var data = $("#rttpg_meta").find('input[name],select[name],textarea[name]').serialize(),
97
+ container = $("#tpg-preview-container").find('.rt-tpg-container'),
98
+ loader = container.find(".rt-content-loader");
99
+ // Add Shortcode ID
100
+ data = data + '&' + $.param({'sc_id': $('#post_ID').val() || 0});
101
+ $(".rt-response")
102
+ .addClass('loading')
103
+ .html('<span>Loading...</span>');
104
+ tpgAjaxCall(null, 'tpgPreviewAjaxCall', data, function (data) {
105
+ if (!data.error) {
106
+ $("#tpg-preview-container").html(data.data);
107
+ initTpg();
108
+ loader.find('.rt-loading-overlay, .rt-loading').remove();
109
+ loader.removeClass('tpg-pre-loader');
110
+ }
111
+ $(".rt-response").removeClass('loading').html('');
112
+ });
113
+ }
114
+ }
115
+
116
+ function tpgAjaxCall(element, action, arg, handle) {
117
+ var data;
118
+ if (action) data = "action=" + action;
119
+ if (arg) data = arg + "&action=" + action;
120
+ if (arg && !action) data = arg;
121
+
122
+ var n = data.search(rttpg.nonceID);
123
+ if (n < 0) {
124
+ data = data + "&rttpg_nonce=" + rttpg.nonce;
125
+ }
126
+ $.ajax({
127
+ type: "post",
128
+ url: rttpg.ajaxurl,
129
+ data: data,
130
+ beforeSend: function () {
131
+ if (element) {
132
+ $("<span class='rt-loading'></span>").insertAfter(element);
133
+ }
134
+ },
135
+ success: function (data) {
136
+ if (element) {
137
+ element.next(".rt-loading").remove();
138
+ }
139
+ handle(data);
140
+ }
141
+ });
142
+ }
143
+
144
  })(jQuery);
145
 
146
+ function rtTPGTaxonomyListByPostType(postType, $this) {
147
 
148
+ var arg = "post_type=" + postType;
149
+ tpgAjaxCall($this, 'rtTPGTaxonomyListByPostType', arg, function (data) {
150
  //console.log(data);
151
+ if (data.error) {
152
  alert(data.msg);
153
+ } else {
154
  jQuery('.rt-tpg-filter.taxonomy > .taxonomy-field').html(data.data).show('slow');
155
  }
156
  });
157
  }
158
 
159
+ function rtTPGIsotopeFilter($this) {
160
+ var arg = "post_type=" + $this.val();
161
  var bindElement = $this;
162
  var target = jQuery('.field-holder.sc-isotope-filter .field > select');
163
+ tpgAjaxCall(bindElement, 'rtTPGIsotopeFilter', arg, function (data) {
164
+ if (data.error) {
165
  alert(data.msg);
166
+ } else {
167
  target.html(data.data);
168
  tgpLiveReloadScript();
169
  }
170
  });
171
  }
172
 
173
+ function rtTPGTermListByTaxonomy($this) {
174
  var term = $this.val();
175
  var targetHolder = jQuery('.rt-tpg-filter.taxonomy').children('.rt-tpg-filter-item').children('.field-holder').children('.term-filter-holder');
176
+ var target = targetHolder.children('.term-filter-item-container.' + term);
177
+ if ($this.is(':checked')) {
178
+ var arg = "taxonomy=" + $this.val();
179
  var bindElement = $this;
180
+ tpgAjaxCall(bindElement, 'rtTPGTermListByTaxonomy', arg, function (data) {
181
  //console.log(data);
182
+ if (data.error) {
183
  alert(data.msg);
184
+ } else {
185
  targetHolder.show();
186
  jQuery(data.data).prependTo(targetHolder).fadeIn('slow');
187
  tgpLiveReloadScript();
188
  }
189
  });
190
+ } else {
191
  target.hide('slow').html('').remove();
192
  }
193
 
194
  var termLength = jQuery('input[name="tpg_taxonomy[]"]:checked').length;
195
+ if (termLength > 1) {
196
  jQuery('.field-holder.term-filter-item-relation ').show('slow');
197
+ } else {
198
  jQuery('.field-holder.term-filter-item-relation ').hide('slow');
199
  }
200
 
201
  }
202
+
203
+ function rtTPGSettings(e) {
204
  jQuery('rt-response').hide();
205
+ var arg = jQuery(e).serialize();
206
  var bindElement = jQuery('.rtSaveButton');
207
+ tpgAjaxCall(bindElement, 'rtTPGSettings', arg, function (data) {
208
+ if (data.error) {
209
  jQuery('.rt-response').addClass('updated');
210
  jQuery('.rt-response').removeClass('error');
211
  jQuery('.rt-response').show('slow').text(data.msg);
212
+ } else {
213
  jQuery('.rt-response').addClass('error');
214
  jQuery('.rt-response').show('slow').text(data.msg);
215
  }
218
  }
219
 
220
 
221
+ function tpgAjaxCall(element, action, arg, handle) {
222
  var data;
223
+ if (action) data = "action=" + action;
224
+ if (arg) data = arg + "&action=" + action;
225
+ if (arg && !action) data = arg;
226
 
227
  var n = data.search(rttpg.nonceID);
228
+ if (n < 0) {
229
  data = data + "&rttpg_nonce=" + rttpg.nonce;
230
  }
231
  jQuery.ajax({
232
  type: "post",
233
  url: rttpg.ajaxurl,
234
  data: data,
235
+ beforeSend: function () {
236
+ jQuery("<span class='rt-loading'></span>").insertAfter(element);
237
+ },
238
+ success: function (data) {
239
  jQuery(".rt-loading").remove();
240
  handle(data);
241
  }
242
  });
243
  }
244
 
245
+ function rtTgpFilter() {
246
+ jQuery("#post_filter input[type=checkbox]:checked").each(function () {
247
+ var id = jQuery(this).val();
248
+ jQuery(".rt-tpg-filter." + id).show();
249
  });
250
 
251
+ jQuery("#post-taxonomy input[type=checkbox]:checked").each(function () {
252
+ var id = jQuery(this).val();
253
+ jQuery(".filter-item." + id).show();
254
  });
255
 
256
  }
257
 
258
+ function thpShowHideScMeta() {
259
 
260
  var layout = jQuery("#rt-tpg-sc-layout").val();
261
+ if (layout == 'isotope1') {
262
  jQuery(".field-holder.pagination, .field-holder.posts-per-page").hide();
263
  jQuery(".field-holder.sc-isotope-filter").show();
264
+ } else {
265
  jQuery(".field-holder.pagination").show();
266
  jQuery(".field-holder.sc-isotope-filter").hide();
267
  var pagination = jQuery("#rt-tpg-pagination").is(':checked');
268
+ if (pagination) {
269
  jQuery(".field-holder.posts-per-page").show();
270
+ } else {
271
  jQuery(".field-holder.posts-per-page").hide();
272
  }
273
  }
274
+ if (layout == 'layout2' || layout == 'layout3') {
275
  jQuery('.holder-layout2-image-column').show();
276
+ } else {
277
  jQuery('.holder-layout2-image-column').hide();
278
  }
279
+ if (jQuery("#post-taxonomy input[name='tpg_taxonomy[]']").is(":checked")) {
280
  jQuery(".rt-tpg-filter-item.term-filter-item").show();
281
+ } else {
282
  jQuery(".rt-tpg-filter-item.term-filter-item").hide();
283
  }
284
 
285
 
286
+ if (jQuery("#rt-feature-image").is(':checked')) {
287
  jQuery(".field-holder.feature-image-options").hide();
288
+ } else {
289
  jQuery(".field-holder.feature-image-options").show();
290
  }
291
 
292
  }
293
 
294
+ function tgpLiveReloadScript() {
295
+ jQuery("select.rt-select2").select2({dropdownAutoWidth: true});
296
  }
assets/js/rttpg.js CHANGED
@@ -5,7 +5,6 @@
5
  $('.rt-tpg-container').each(function () {
6
  // jetpack Lazy load
7
  $(this).find('img.jetpack-lazy-image:not(.jetpack-lazy-image--handled)').each(function () {
8
- console.log('trigger');
9
  $(this).addClass('jetpack-lazy-image--handled').removeAttr('srcset').removeAttr('data-lazy-src').attr('data-lazy-loaded', 1);
10
  });
11
  });
5
  $('.rt-tpg-container').each(function () {
6
  // jetpack Lazy load
7
  $(this).find('img.jetpack-lazy-image:not(.jetpack-lazy-image--handled)').each(function () {
 
8
  $(this).addClass('jetpack-lazy-image--handled').removeAttr('srcset').removeAttr('data-lazy-src').attr('data-lazy-loaded', 1);
9
  });
10
  });
assets/vendor/select2/select2.png CHANGED
Binary file
assets/vendor/select2/select2x2.png ADDED
Binary file
languages/the-post-grid.pot CHANGED
@@ -1,222 +1,330 @@
1
- # Copyright (C) 2019 The Post Grid
2
- # This file is distributed under the same license as the The Post Grid package.
3
  msgid ""
4
  msgstr ""
 
5
  "Project-Id-Version: The Post Grid\n"
 
 
 
 
6
  "MIME-Version: 1.0\n"
7
  "Content-Type: text/plain; charset=UTF-8\n"
8
  "Content-Transfer-Encoding: 8bit\n"
 
9
  "X-Poedit-Basepath: ..\n"
10
- "X-Poedit-KeywordsList: __;_e;_ex:1,2c;_n:1,2;_n_noop:1,2;_nx:1,2,4c;_nx_noop:1,2,3c;_x:1,2c;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c\n"
 
 
 
 
11
  "X-Poedit-SearchPath-0: .\n"
12
  "X-Poedit-SearchPathExcluded-0: *.js\n"
13
- "X-Poedit-SourceCharset: UTF-8\n"
14
- "Plural-Forms: nplurals=2; plural=(n != 1);\n"
15
 
16
- #: ../lib/classes/rtTPGAjaxResponse.php:26
17
  msgid "Settings successfully updated"
18
  msgstr ""
19
 
20
- #: ../lib/classes/rtTPGAjaxResponse.php:28
21
  msgid "Security Error !!"
22
  msgstr ""
23
 
24
- #: ../lib/classes/rtTPGAjaxResponse.php:56
25
  msgid "<div class=\"field-holder\">No Taxonomy found</div>"
26
  msgstr ""
27
 
28
- #: ../lib/classes/rtTPGAjaxResponse.php:60, ../lib/classes/rtTPGAjaxResponse.php:79, ../lib/classes/rtTPGAjaxResponse.php:118
 
29
  msgid "Security error"
30
  msgstr ""
31
 
32
- #: ../lib/classes/rtTPGAjaxResponse.php:137
33
  msgid "Select Short code"
34
  msgstr ""
35
 
36
- #: ../lib/classes/rtTPGAjaxResponse.php:139
37
  msgid "Default"
38
  msgstr ""
39
 
40
- #: ../lib/classes/rtTPGAjaxResponse.php:148
41
  msgid "No shortCode found."
42
  msgstr ""
43
 
44
- #: ../lib/classes/rtTPGInit.php:23, ../lib/classes/rtTPGInit.php:24, ../lib/vendor/RtElementorWidget.php:10, ../lib/vendor/RtElementorWidget.php:26, ../lib/widgets/RT_TPGWidget.php:15
 
 
 
45
  msgid "The Post Grid"
46
  msgstr ""
47
 
48
- #: ../lib/classes/rtTPGInit.php:25
49
  msgid "Add New Grid"
50
  msgstr ""
51
 
52
- #: ../lib/classes/rtTPGInit.php:26
53
  msgid "All Grids"
54
  msgstr ""
55
 
56
- #: ../lib/classes/rtTPGInit.php:27
57
  msgid "Add New Post Grid"
58
  msgstr ""
59
 
60
- #: ../lib/classes/rtTPGInit.php:28
61
  msgid "Edit Post Grid"
62
  msgstr ""
63
 
64
- #: ../lib/classes/rtTPGInit.php:29
65
  msgid "New Post Grid"
66
  msgstr ""
67
 
68
- #: ../lib/classes/rtTPGInit.php:30
69
  msgid "View Post Grid"
70
  msgstr ""
71
 
72
- #: ../lib/classes/rtTPGInit.php:31
73
  msgid "Search Post Grids"
74
  msgstr ""
75
 
76
- #: ../lib/classes/rtTPGInit.php:32
77
  msgid "No Post Grids found"
78
  msgstr ""
79
 
80
- #: ../lib/classes/rtTPGInit.php:33
81
  msgid "No Post Grids found in Trash"
82
  msgstr ""
83
 
84
- #: ../lib/classes/rtTPGInit.php:120, ../lib/classes/rtTPGInit.php:120
85
  msgid "Settings"
86
  msgstr ""
87
 
88
- #: ../lib/classes/rtTPGMeta.php:27
89
  msgid "Shortcode"
90
  msgstr ""
91
 
92
- #: ../lib/classes/rtTPGMeta.php:115
 
 
 
 
 
 
 
 
 
 
 
 
93
  msgid "Post Source"
94
  msgstr ""
95
 
96
- #: ../lib/classes/rtTPGMeta.php:116
97
  msgid "Layout Settings"
98
  msgstr ""
99
 
100
- #: ../lib/classes/rtTPGMeta.php:117
101
  msgid "Field Selection"
102
  msgstr ""
103
 
104
- #: ../lib/classes/rtTPGMeta.php:118
105
  msgid "Style"
106
  msgstr ""
107
 
108
- #: ../lib/classes/rtTPGOptions.php:68
109
  msgid "Script before item load"
110
  msgstr ""
111
 
112
- #: ../lib/classes/rtTPGOptions.php:76
113
  msgid "Script After item load"
114
  msgstr ""
115
 
116
- #: ../lib/classes/rtTPGOptions.php:84
117
  msgid "After Loaded Script"
118
  msgstr ""
119
 
120
- #: ../lib/classes/rtTPGOptions.php:100
121
  msgid "List of post IDs to show (comma-separated values, for example: 1,2,3)"
122
  msgstr ""
123
 
124
- #: ../lib/classes/rtTPGOptions.php:108
125
  msgid "List of post IDs to hide (comma-separated values, for example: 1,2,3)"
126
  msgstr ""
127
 
128
- #: ../lib/classes/rtTPGOptions.php:116
129
  msgid "The number of posts to show. Set empty to show all found posts."
130
  msgstr ""
131
 
132
- #: ../lib/classes/rtTPGOptions.php:189
 
 
 
 
 
 
 
 
 
133
  msgid "Image column"
134
  msgstr ""
135
 
136
- #: ../lib/classes/rtTPGOptions.php:220
137
- msgid "If value of Limit setting is not blank (empty), this value should be smaller than Limit value."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
138
  msgstr ""
139
 
140
- #: ../lib/classes/rtTPGOptions.php:263
141
- msgid "Excerpt limit only integer number is allowed, Leave it blank for full excerpt. Note: This will remove all html tag"
142
  msgstr ""
143
 
144
- #: ../lib/classes/rtTPGOptions.php:385
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
145
  msgid "Feature Image"
146
  msgstr ""
147
 
148
- #: ../lib/classes/rtTPGOptions.php:386
149
  msgid "First Image from content"
150
  msgstr ""
151
 
152
- #: ../lib/classes/rtTPGOptions.php:414
153
  msgid "Title"
154
  msgstr ""
155
 
156
- #: ../lib/classes/rtTPGOptions.php:415
157
  msgid "Excerpt"
158
  msgstr ""
159
 
160
- #: ../lib/classes/rtTPGOptions.php:416, ../lib/classes/rtTPGShortCode.php:69
 
161
  msgid "Read More"
162
  msgstr ""
163
 
164
- #: ../lib/classes/rtTPGOptions.php:417
165
  msgid "Post Date"
166
  msgstr ""
167
 
168
- #: ../lib/classes/rtTPGOptions.php:418
169
  msgid "Author"
170
  msgstr ""
171
 
172
- #: ../lib/classes/rtTPGOptions.php:419
173
  msgid "Categories"
174
  msgstr ""
175
 
176
- #: ../lib/classes/rtTPGOptions.php:420
177
  msgid "Tags"
178
  msgstr ""
179
 
180
- #: ../lib/classes/rtTPGOptions.php:421
181
  msgid "Comment Count"
182
  msgstr ""
183
 
184
- #: ../lib/classes/rtTPGShortCode.php:245
185
- msgid "Show all"
186
  msgstr ""
187
 
188
- #: ../lib/classes/rtTPGShortCode.php:304
189
- msgid "No post found"
190
  msgstr ""
191
 
192
- #: ../lib/classes/rtTPGShortCode.php:329
193
  msgid "No shortCode found"
194
  msgstr ""
195
 
196
- #: ../lib/vendor/RtElementorWidget.php:36
197
  msgid "Post Grid"
198
  msgstr ""
199
 
200
- #: ../lib/widgets/RT_TPGWidget.php:14
 
 
 
 
 
 
 
 
 
 
 
 
201
  msgid "Display the post grid."
202
  msgstr ""
203
 
204
- #: ../lib/widgets/RT_TPGWidget.php:46
205
  msgid "Title:"
206
  msgstr ""
207
 
208
- #: ../lib/widgets/RT_TPGWidget.php:52
209
  msgid "Select post grid"
210
  msgstr ""
211
 
212
- #: ../lib/views/settings/settings.php:8
213
- msgid "The Post Grid Settings"
214
  msgstr ""
215
 
216
- #: ../lib/views/settings/settings.php:9
217
- msgid "General settings"
 
 
218
  msgstr ""
219
 
220
- #: ../lib/views/settings/settings.php:12
221
- msgid "Documentation"
 
 
 
 
222
  msgstr ""
1
+ #, fuzzy
 
2
  msgid ""
3
  msgstr ""
4
+ "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
5
  "Project-Id-Version: The Post Grid\n"
6
+ "POT-Creation-Date: 2019-08-26 12:13+0600\n"
7
+ "PO-Revision-Date: 2019-08-26 12:12+0600\n"
8
+ "Last-Translator: \n"
9
+ "Language-Team: \n"
10
  "MIME-Version: 1.0\n"
11
  "Content-Type: text/plain; charset=UTF-8\n"
12
  "Content-Transfer-Encoding: 8bit\n"
13
+ "X-Generator: Poedit 1.8.7\n"
14
  "X-Poedit-Basepath: ..\n"
15
+ "X-Poedit-WPHeader: the-post-grid.php\n"
16
+ "X-Poedit-SourceCharset: UTF-8\n"
17
+ "X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;"
18
+ "esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;"
19
+ "_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
20
  "X-Poedit-SearchPath-0: .\n"
21
  "X-Poedit-SearchPathExcluded-0: *.js\n"
 
 
22
 
23
+ #: lib/classes/rtTPGAjaxResponse.php:26
24
  msgid "Settings successfully updated"
25
  msgstr ""
26
 
27
+ #: lib/classes/rtTPGAjaxResponse.php:28
28
  msgid "Security Error !!"
29
  msgstr ""
30
 
31
+ #: lib/classes/rtTPGAjaxResponse.php:56
32
  msgid "<div class=\"field-holder\">No Taxonomy found</div>"
33
  msgstr ""
34
 
35
+ #: lib/classes/rtTPGAjaxResponse.php:60 lib/classes/rtTPGAjaxResponse.php:79
36
+ #: lib/classes/rtTPGAjaxResponse.php:118
37
  msgid "Security error"
38
  msgstr ""
39
 
40
+ #: lib/classes/rtTPGAjaxResponse.php:137
41
  msgid "Select Short code"
42
  msgstr ""
43
 
44
+ #: lib/classes/rtTPGAjaxResponse.php:139
45
  msgid "Default"
46
  msgstr ""
47
 
48
+ #: lib/classes/rtTPGAjaxResponse.php:148
49
  msgid "No shortCode found."
50
  msgstr ""
51
 
52
+ #. Plugin Name of the plugin/theme
53
+ #: lib/classes/rtTPGInit.php:22 lib/classes/rtTPGInit.php:23
54
+ #: lib/vendor/RtElementorWidget.php:10 lib/vendor/RtElementorWidget.php:26
55
+ #: lib/widgets/RT_TPGWidget.php:15
56
  msgid "The Post Grid"
57
  msgstr ""
58
 
59
+ #: lib/classes/rtTPGInit.php:24
60
  msgid "Add New Grid"
61
  msgstr ""
62
 
63
+ #: lib/classes/rtTPGInit.php:25
64
  msgid "All Grids"
65
  msgstr ""
66
 
67
+ #: lib/classes/rtTPGInit.php:26
68
  msgid "Add New Post Grid"
69
  msgstr ""
70
 
71
+ #: lib/classes/rtTPGInit.php:27
72
  msgid "Edit Post Grid"
73
  msgstr ""
74
 
75
+ #: lib/classes/rtTPGInit.php:28
76
  msgid "New Post Grid"
77
  msgstr ""
78
 
79
+ #: lib/classes/rtTPGInit.php:29
80
  msgid "View Post Grid"
81
  msgstr ""
82
 
83
+ #: lib/classes/rtTPGInit.php:30
84
  msgid "Search Post Grids"
85
  msgstr ""
86
 
87
+ #: lib/classes/rtTPGInit.php:31
88
  msgid "No Post Grids found"
89
  msgstr ""
90
 
91
+ #: lib/classes/rtTPGInit.php:32
92
  msgid "No Post Grids found in Trash"
93
  msgstr ""
94
 
95
+ #: lib/classes/rtTPGInit.php:112
96
  msgid "Settings"
97
  msgstr ""
98
 
99
+ #: lib/classes/rtTPGMeta.php:27
100
  msgid "Shortcode"
101
  msgstr ""
102
 
103
+ #: lib/classes/rtTPGMeta.php:85
104
+ msgid "Short Code Generator"
105
+ msgstr ""
106
+
107
+ #: lib/classes/rtTPGMeta.php:92
108
+ msgid "Pro Features"
109
+ msgstr ""
110
+
111
+ #: lib/classes/rtTPGMeta.php:99
112
+ msgid "Layout Preview"
113
+ msgstr ""
114
+
115
+ #: lib/classes/rtTPGMeta.php:141
116
  msgid "Post Source"
117
  msgstr ""
118
 
119
+ #: lib/classes/rtTPGMeta.php:142
120
  msgid "Layout Settings"
121
  msgstr ""
122
 
123
+ #: lib/classes/rtTPGMeta.php:143
124
  msgid "Field Selection"
125
  msgstr ""
126
 
127
+ #: lib/classes/rtTPGMeta.php:144
128
  msgid "Style"
129
  msgstr ""
130
 
131
+ #: lib/classes/rtTPGOptions.php:69
132
  msgid "Script before item load"
133
  msgstr ""
134
 
135
+ #: lib/classes/rtTPGOptions.php:77
136
  msgid "Script After item load"
137
  msgstr ""
138
 
139
+ #: lib/classes/rtTPGOptions.php:85
140
  msgid "After Loaded Script"
141
  msgstr ""
142
 
143
+ #: lib/classes/rtTPGOptions.php:101
144
  msgid "List of post IDs to show (comma-separated values, for example: 1,2,3)"
145
  msgstr ""
146
 
147
+ #: lib/classes/rtTPGOptions.php:109
148
  msgid "List of post IDs to hide (comma-separated values, for example: 1,2,3)"
149
  msgstr ""
150
 
151
+ #: lib/classes/rtTPGOptions.php:117
152
  msgid "The number of posts to show. Set empty to show all found posts."
153
  msgstr ""
154
 
155
+ #: lib/classes/rtTPGOptions.php:190
156
+ msgid "Show all text"
157
+ msgstr ""
158
+
159
+ #: lib/classes/rtTPGOptions.php:191 lib/classes/rtTPGShortCode.php:71
160
+ #: lib/classes/rtTPGShortCode.php:100
161
+ msgid "Show all"
162
+ msgstr ""
163
+
164
+ #: lib/classes/rtTPGOptions.php:197
165
  msgid "Image column"
166
  msgstr ""
167
 
168
+ #: lib/classes/rtTPGOptions.php:228
169
+ msgid ""
170
+ "If value of Limit setting is not blank (empty), this value should be smaller "
171
+ "than Limit value."
172
+ msgstr ""
173
+
174
+ #: lib/classes/rtTPGOptions.php:261
175
+ msgid "Title limit"
176
+ msgstr ""
177
+
178
+ #: lib/classes/rtTPGOptions.php:262
179
+ msgid ""
180
+ "Title limit only integer number is allowed, Leave it blank for full title."
181
+ msgstr ""
182
+
183
+ #: lib/classes/rtTPGOptions.php:268
184
+ msgid "Title limit type"
185
+ msgstr ""
186
+
187
+ #: lib/classes/rtTPGOptions.php:276
188
+ msgid "Excerpt limit"
189
+ msgstr ""
190
+
191
+ #: lib/classes/rtTPGOptions.php:278
192
+ msgid ""
193
+ "Excerpt limit only integer number is allowed, Leave it blank for full "
194
+ "excerpt. Note: This will remove all html tag"
195
+ msgstr ""
196
+
197
+ #: lib/classes/rtTPGOptions.php:283
198
+ msgid "Excerpt Type"
199
+ msgstr ""
200
+
201
+ #: lib/classes/rtTPGOptions.php:292
202
+ msgid "Excerpt more text"
203
  msgstr ""
204
 
205
+ #: lib/classes/rtTPGOptions.php:299
206
+ msgid "Read more text"
207
  msgstr ""
208
 
209
+ #: lib/classes/rtTPGOptions.php:306
210
+ msgid "Overlay"
211
+ msgstr ""
212
+
213
+ #: lib/classes/rtTPGOptions.php:313
214
+ msgid "Title tag"
215
+ msgstr ""
216
+
217
+ #: lib/classes/rtTPGOptions.php:380
218
+ msgid "Title color"
219
+ msgstr ""
220
+
221
+ #: lib/classes/rtTPGOptions.php:387
222
+ msgid "Title hover color"
223
+ msgstr ""
224
+
225
+ #: lib/classes/rtTPGOptions.php:396
226
+ msgid "Read more button border radius"
227
+ msgstr ""
228
+
229
+ #: lib/classes/rtTPGOptions.php:397
230
+ msgid "Leave it blank for default"
231
+ msgstr ""
232
+
233
+ #: lib/classes/rtTPGOptions.php:426
234
  msgid "Feature Image"
235
  msgstr ""
236
 
237
+ #: lib/classes/rtTPGOptions.php:427
238
  msgid "First Image from content"
239
  msgstr ""
240
 
241
+ #: lib/classes/rtTPGOptions.php:455
242
  msgid "Title"
243
  msgstr ""
244
 
245
+ #: lib/classes/rtTPGOptions.php:456
246
  msgid "Excerpt"
247
  msgstr ""
248
 
249
+ #: lib/classes/rtTPGOptions.php:457 lib/classes/rtTPGShortCode.php:69
250
+ #: lib/classes/rtTPGShortCode.php:98
251
  msgid "Read More"
252
  msgstr ""
253
 
254
+ #: lib/classes/rtTPGOptions.php:458
255
  msgid "Post Date"
256
  msgstr ""
257
 
258
+ #: lib/classes/rtTPGOptions.php:459
259
  msgid "Author"
260
  msgstr ""
261
 
262
+ #: lib/classes/rtTPGOptions.php:460
263
  msgid "Categories"
264
  msgstr ""
265
 
266
+ #: lib/classes/rtTPGOptions.php:461
267
  msgid "Tags"
268
  msgstr ""
269
 
270
+ #: lib/classes/rtTPGOptions.php:462
271
  msgid "Comment Count"
272
  msgstr ""
273
 
274
+ #: lib/classes/rtTPGShortCode.php:342
275
+ msgid "No post found"
276
  msgstr ""
277
 
278
+ #: lib/classes/rtTPGShortCode.php:370
279
+ msgid "Session Error !!"
280
  msgstr ""
281
 
282
+ #: lib/classes/rtTPGShortCode.php:372
283
  msgid "No shortCode found"
284
  msgstr ""
285
 
286
+ #: lib/vendor/RtElementorWidget.php:36
287
  msgid "Post Grid"
288
  msgstr ""
289
 
290
+ #: lib/views/settings/settings.php:5
291
+ msgid "The Post Grid Settings"
292
+ msgstr ""
293
+
294
+ #: lib/views/settings/settings.php:6
295
+ msgid "General settings"
296
+ msgstr ""
297
+
298
+ #: lib/views/settings/settings.php:9
299
+ msgid "Documentation"
300
+ msgstr ""
301
+
302
+ #: lib/widgets/RT_TPGWidget.php:14
303
  msgid "Display the post grid."
304
  msgstr ""
305
 
306
+ #: lib/widgets/RT_TPGWidget.php:46
307
  msgid "Title:"
308
  msgstr ""
309
 
310
+ #: lib/widgets/RT_TPGWidget.php:52
311
  msgid "Select post grid"
312
  msgstr ""
313
 
314
+ #. Plugin URI of the plugin/theme
315
+ msgid "http://demo.radiustheme.com/wordpress/plugins/the-post-grid/"
316
  msgstr ""
317
 
318
+ #. Description of the plugin/theme
319
+ msgid ""
320
+ "Fast & Easy way to display WordPress post in Grid, List & Isotope view "
321
+ "( filter by category, tag, author..) without a single line of coding."
322
  msgstr ""
323
 
324
+ #. Author of the plugin/theme
325
+ msgid "RadiusTheme"
326
+ msgstr ""
327
+
328
+ #. Author URI of the plugin/theme
329
+ msgid "https://radiustheme.com/"
330
  msgstr ""
lib/classes/rtTPGHelper.php CHANGED
@@ -200,6 +200,31 @@ if ( ! class_exists( 'rtTPGHelper' ) ):
200
  return $imgSrc;
201
  }
202
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
203
  function get_the_excerpt( $post_id, $data = array() ) {
204
  $limit = isset( $data['excerpt_limit'] ) ? abs( $data['excerpt_limit'] ) : 0;
205
  $defaultExcerpt = get_the_excerpt( $post_id );
@@ -223,7 +248,7 @@ if ( ! class_exists( 'rtTPGHelper' ) ):
223
  }
224
  } else {
225
  if ( $limit > 0 && strlen( $excerpt ) > $limit ) {
226
- $excerpt = mb_substr( $excerpt, 0, $limit , "utf-8");
227
  $excerpt = preg_replace( '/\W\w+\s*(\W*)$/', '$1', $excerpt );
228
  }
229
  }
@@ -239,7 +264,7 @@ if ( ! class_exists( 'rtTPGHelper' ) ):
239
  );
240
  $excerpt = nl2br( wp_kses( $excerpt, $allowed_html ) );
241
  }
242
- $excerpt = ($more ? $excerpt . " " . $more : $excerpt);
243
 
244
 
245
  return apply_filters( 'tpg_get_the_excerpt', $excerpt, $post_id, $data, $defaultExcerpt );
200
  return $imgSrc;
201
  }
202
 
203
+ function get_the_title( $post_id, $data = array() ) {
204
+ $title = $originalTitle = get_the_title( $post_id );
205
+ $limit = isset( $data['title_limit'] ) ? abs( $data['title_limit'] ) : 0;
206
+ $limit_type = isset( $data['title_limit_type'] ) ? trim( $data['title_limit_type'] ) : 'character';
207
+ if ( $limit ) {
208
+ if ( $limit_type == "word" ) {
209
+ $limit = $limit + 1;
210
+ $title = explode( ' ', $title, $limit );
211
+ if ( count( $title ) >= $limit ) {
212
+ array_pop( $title );
213
+ $title = implode( " ", $title );
214
+ } else {
215
+ $title = $originalTitle;
216
+ }
217
+ } else {
218
+ if ( $limit > 0 && strlen( $title ) > $limit ) {
219
+ $title = mb_substr( $title, 0, $limit, "utf-8" );
220
+ $title = preg_replace( '/\W\w+\s*(\W*)$/', '$1', $title );
221
+ }
222
+ }
223
+ }
224
+
225
+ return apply_filters( 'tpg_get_the_title', $title, $post_id, $data, $originalTitle );
226
+ }
227
+
228
  function get_the_excerpt( $post_id, $data = array() ) {
229
  $limit = isset( $data['excerpt_limit'] ) ? abs( $data['excerpt_limit'] ) : 0;
230
  $defaultExcerpt = get_the_excerpt( $post_id );
248
  }
249
  } else {
250
  if ( $limit > 0 && strlen( $excerpt ) > $limit ) {
251
+ $excerpt = mb_substr( $excerpt, 0, $limit, "utf-8" );
252
  $excerpt = preg_replace( '/\W\w+\s*(\W*)$/', '$1', $excerpt );
253
  }
254
  }
264
  );
265
  $excerpt = nl2br( wp_kses( $excerpt, $allowed_html ) );
266
  }
267
+ $excerpt = ( $more ? $excerpt . " " . $more : $excerpt );
268
 
269
 
270
  return apply_filters( 'tpg_get_the_excerpt', $excerpt, $post_id, $data, $defaultExcerpt );
lib/classes/rtTPGInit.php CHANGED
@@ -1,197 +1,182 @@
1
  <?php
2
 
3
- if ( ! class_exists( 'rtTPGInit' ) ):
4
- class rtTPGInit {
5
-
6
- function __construct()
7
- {
8
- add_action( 'init', array( $this, 'init' ), 1 );
9
- add_action( 'admin_menu', array( $this, 'admin_menu' ) );
10
- add_action( 'plugins_loaded', array( $this, 'the_post_grid_load_text_domain' ) );
11
- register_activation_hook( RT_THE_POST_GRID_PLUGIN_ACTIVE_FILE_NAME, array( $this, 'activate' ) );
12
- register_deactivation_hook( RT_THE_POST_GRID_PLUGIN_ACTIVE_FILE_NAME, array( $this, 'deactivate' ) );
13
- add_filter( 'plugin_action_links_' . RT_THE_POST_GRID_PLUGIN_ACTIVE_FILE_NAME,
14
- array( $this, 'rt_post_grid_marketing' ) );
15
- add_action( 'admin_enqueue_scripts', array( $this, 'settings_admin_enqueue_scripts' ) );
16
- }
17
-
18
- function init()
19
- {
20
-
21
- // Create the post grid post type
22
- $labels = array(
23
- 'name' => __( 'The Post Grid', 'the-post-grid' ),
24
- 'singular_name' => __( 'The Post Grid', 'the-post-grid' ),
25
- 'add_new' => __( 'Add New Grid', 'the-post-grid' ),
26
- 'all_items' => __( 'All Grids', 'the-post-grid' ),
27
- 'add_new_item' => __( 'Add New Post Grid', 'the-post-grid' ),
28
- 'edit_item' => __( 'Edit Post Grid', 'the-post-grid' ),
29
- 'new_item' => __( 'New Post Grid', 'the-post-grid' ),
30
- 'view_item' => __( 'View Post Grid', 'the-post-grid' ),
31
- 'search_items' => __( 'Search Post Grids', 'the-post-grid' ),
32
- 'not_found' => __( 'No Post Grids found', 'the-post-grid' ),
33
- 'not_found_in_trash' => __( 'No Post Grids found in Trash', 'the-post-grid' ),
34
- );
35
-
36
- global $rtTPG;
37
-
38
- register_post_type( $rtTPG->post_type, array(
39
- 'labels' => $labels,
40
- 'public' => false,
41
- 'show_ui' => true,
42
- '_builtin' => false,
43
- 'capability_type' => 'page',
44
- 'hierarchical' => true,
45
- 'menu_icon' => $rtTPG->assetsUrl . 'images/rt-tpg-menu.png',
46
- 'rewrite' => false,
47
- 'query_var' => $rtTPG->post_type,
48
- 'supports' => array(
49
- 'title',
50
- ),
51
- 'show_in_menu' => true,
52
- 'menu_position' => 20,
53
- ) );
54
-
55
- // register acf scripts
56
- $scripts = array();
57
- $styles = array();
58
- $scripts[] = array(
59
- 'handle' => 'rt-image-load-js',
60
- 'src' => $rtTPG->assetsUrl . "vendor/isotope/imagesloaded.pkgd.min.js",
61
- 'deps' => array( 'jquery' ),
62
- 'footer' => true
63
- );
64
- $scripts[] = array(
65
- 'handle' => 'rt-isotope-js',
66
- 'src' => $rtTPG->assetsUrl . "vendor/isotope/isotope.pkgd.min.js",
67
- 'deps' => array( 'jquery' ),
68
- 'footer' => true
69
- );
70
- $scripts[] = array(
71
- 'handle' => 'rt-actual-height-js',
72
- 'src' => $rtTPG->assetsUrl . "vendor/actual-height/jquery.actual.min.js",
73
- 'deps' => array( 'jquery' ),
74
- 'footer' => true
75
- );
76
- $scripts[] = array(
77
- 'handle' => 'rt-tpg',
78
- 'src' => $rtTPG->assetsUrl . "js/rttpg.js",
79
- 'deps' => array( 'jquery' ),
80
- 'footer' => true
81
- );
82
- // register acf styles
83
- $styles['rt-fontawsome'] = $rtTPG->assetsUrl . 'vendor/font-awesome/css/font-awesome.min.css';
84
- $styles['rt-tpg'] = $rtTPG->assetsUrl . 'css/thepostgrid.css';
85
-
86
- if ( is_admin() ) {
87
-
88
- $scripts[] = array(
89
- 'handle' => 'rt-select2-js',
90
- 'src' => $rtTPG->assetsUrl . "vendor/select2/select2.min.js",
91
- 'deps' => array( 'jquery' ),
92
- 'footer' => false
93
- );
94
- $scripts[] = array(
95
- 'handle' => 'rt-tpg-admin',
96
- 'src' => $rtTPG->assetsUrl . "js/admin.js",
97
- 'deps' => array( 'jquery' ),
98
- 'footer' => true
99
- );
100
- $styles['rt-select2-css'] = $rtTPG->assetsUrl . 'vendor/select2/select2.css';
101
- $styles['rt-select2-bootstrap-css'] = $rtTPG->assetsUrl . 'vendor/select2/select2-bootstrap.css';
102
- $styles['rt-tpg-admin'] = $rtTPG->assetsUrl . 'css/admin.css';
103
- }
104
-
105
- $version = ( defined( 'WP_DEBUG' ) && WP_DEBUG ) ? time() : $rtTPG->options['version'];
106
- foreach ( $scripts as $script ) {
107
- wp_register_script( $script['handle'], $script['src'], $script['deps'], $version,
108
- $script['footer'] );
109
- }
110
-
111
-
112
- foreach ( $styles as $k => $v ) {
113
- wp_register_style( $k, $v, false, $version );
114
- }
115
- }
116
-
117
- function admin_menu()
118
- {
119
- global $rtTPG;
120
- add_submenu_page( 'edit.php?post_type=' . $rtTPG->post_type, __( 'Settings', "the-post-grid" ), __( 'Settings', "the-post-grid" ),
121
- 'administrator', 'rttpg_settings', array( $this, 'rttpg_settings' ) );
122
- }
123
-
124
- function rttpg_settings()
125
- {
126
- global $rtTPG;
127
- $rtTPG->render( 'settings.settings' );
128
- }
129
-
130
- public function the_post_grid_load_text_domain()
131
- {
132
- load_plugin_textdomain( 'the-post-grid', false, RT_THE_POST_GRID_LANGUAGE_PATH );
133
- }
134
-
135
- function activate()
136
- {
137
- $this->insertDefaultData();
138
- }
139
-
140
- function deactivate()
141
- {
142
-
143
- }
144
-
145
- private function insertDefaultData()
146
- {
147
- global $rtTPG;
148
- update_option( $rtTPG->options['installed_version'], $rtTPG->options['version'] );
149
- if ( ! get_option( $rtTPG->options['settings'] ) ) {
150
- update_option( $rtTPG->options['settings'], $rtTPG->defaultSettings );
151
- }
152
- }
153
-
154
- function rt_post_grid_marketing( $links )
155
- {
156
- $links[] = '<a target="_blank" href="' . esc_url( 'http://demo.radiustheme.com/wordpress/plugins/the-post-grid/' ) . '">Demo</a>';
157
- $links[] = '<a target="_blank" href="' . esc_url( 'https://www.radiustheme.com/how-to-setup-configure-the-post-grid-free-version-for-wordpress/' ) . '">Documentation</a>';
158
- $links[] = '<a target="_blank" style="color: #39b54a;font-weight: 700;" href="' . esc_url( 'https://www.radiustheme.com/the-post-grid-pro-for-wordpress/' ) . '">Get Pro</a>';
159
-
160
- return $links;
161
- }
162
-
163
-
164
- function settings_admin_enqueue_scripts()
165
- {
166
- global $pagenow, $typenow, $rtTPG;
167
-
168
- // validate page
169
- if ( ! in_array( $pagenow, array( 'edit.php' ) ) ) {
170
- return;
171
- }
172
- if ( $typenow != $rtTPG->post_type ) {
173
- return;
174
- }
175
-
176
- wp_enqueue_script( array(
177
- 'jquery',
178
- 'rt-select2-js',
179
- 'rt-tpg-admin',
180
- ) );
181
-
182
- // styles
183
- wp_enqueue_style( array(
184
- 'rt-select2-css',
185
- 'rt-tpg-admin',
186
- ) );
187
-
188
- $nonce = wp_create_nonce( $rtTPG->nonceText() );
189
- wp_localize_script( 'rt-tpg-admin', 'rttpg',
190
- array(
191
- 'nonceID' => $rtTPG->nonceId(),
192
- 'nonce' => $nonce,
193
- 'ajaxurl' => admin_url( 'admin-ajax.php' )
194
- ) );
195
- }
196
- }
197
  endif;
1
  <?php
2
 
3
+ if (!class_exists('rtTPGInit')):
4
+ class rtTPGInit
5
+ {
6
+
7
+ function __construct() {
8
+ add_action('init', array($this, 'init'), 1);
9
+ add_action('admin_menu', array($this, 'admin_menu'));
10
+ add_action('plugins_loaded', array($this, 'the_post_grid_load_text_domain'));
11
+ register_activation_hook(RT_THE_POST_GRID_PLUGIN_ACTIVE_FILE_NAME, array($this, 'activate'));
12
+ register_deactivation_hook(RT_THE_POST_GRID_PLUGIN_ACTIVE_FILE_NAME, array($this, 'deactivate'));
13
+ add_filter('plugin_action_links_' . RT_THE_POST_GRID_PLUGIN_ACTIVE_FILE_NAME,
14
+ array($this, 'rt_post_grid_marketing'));
15
+ add_action('admin_enqueue_scripts', array($this, 'settings_admin_enqueue_scripts'));
16
+ }
17
+
18
+ function init() {
19
+
20
+ // Create the post grid post type
21
+ $labels = array(
22
+ 'name' => __('The Post Grid', 'the-post-grid'),
23
+ 'singular_name' => __('The Post Grid', 'the-post-grid'),
24
+ 'add_new' => __('Add New Grid', 'the-post-grid'),
25
+ 'all_items' => __('All Grids', 'the-post-grid'),
26
+ 'add_new_item' => __('Add New Post Grid', 'the-post-grid'),
27
+ 'edit_item' => __('Edit Post Grid', 'the-post-grid'),
28
+ 'new_item' => __('New Post Grid', 'the-post-grid'),
29
+ 'view_item' => __('View Post Grid', 'the-post-grid'),
30
+ 'search_items' => __('Search Post Grids', 'the-post-grid'),
31
+ 'not_found' => __('No Post Grids found', 'the-post-grid'),
32
+ 'not_found_in_trash' => __('No Post Grids found in Trash', 'the-post-grid'),
33
+ );
34
+
35
+ global $rtTPG;
36
+
37
+ register_post_type($rtTPG->post_type, array(
38
+ 'labels' => $labels,
39
+ 'public' => false,
40
+ 'show_ui' => true,
41
+ '_builtin' => false,
42
+ 'capability_type' => 'page',
43
+ 'hierarchical' => true,
44
+ 'menu_icon' => $rtTPG->assetsUrl . 'images/rt-tpg-menu.png',
45
+ 'rewrite' => false,
46
+ 'query_var' => $rtTPG->post_type,
47
+ 'supports' => array(
48
+ 'title',
49
+ ),
50
+ 'show_in_menu' => true,
51
+ 'menu_position' => 20,
52
+ ));
53
+
54
+ // register acf scripts
55
+ $scripts = array();
56
+ $styles = array();
57
+ $scripts[] = array(
58
+ 'handle' => 'rt-isotope-js',
59
+ 'src' => $rtTPG->assetsUrl . "vendor/isotope/isotope.pkgd.min.js",
60
+ 'deps' => array('jquery', 'imagesloaded'),
61
+ 'footer' => true
62
+ );
63
+ $scripts[] = array(
64
+ 'handle' => 'rt-actual-height-js',
65
+ 'src' => $rtTPG->assetsUrl . "vendor/actual-height/jquery.actual.min.js",
66
+ 'deps' => array('jquery', 'imagesloaded'),
67
+ 'footer' => true
68
+ );
69
+ $scripts[] = array(
70
+ 'handle' => 'rt-tpg',
71
+ 'src' => $rtTPG->assetsUrl . "js/rttpg.js",
72
+ 'deps' => array('jquery'),
73
+ 'footer' => true
74
+ );
75
+ // register acf styles
76
+ $styles['rt-fontawsome'] = $rtTPG->assetsUrl . 'vendor/font-awesome/css/font-awesome.min.css';
77
+ $styles['rt-tpg'] = $rtTPG->assetsUrl . 'css/thepostgrid.css';
78
+
79
+ if (is_admin()) {
80
+
81
+ $scripts[] = array(
82
+ 'handle' => 'rt-select2-js',
83
+ 'src' => $rtTPG->assetsUrl . "vendor/select2/select2.min.js",
84
+ 'deps' => array('jquery'),
85
+ 'footer' => false
86
+ );
87
+ $scripts[] = array(
88
+ 'handle' => 'rt-tpg-admin',
89
+ 'src' => $rtTPG->assetsUrl . "js/admin.js",
90
+ 'deps' => array('jquery'),
91
+ 'footer' => true
92
+ );
93
+ $styles['rt-select2-css'] = $rtTPG->assetsUrl . 'vendor/select2/select2.css';
94
+ $styles['rt-select2-bootstrap-css'] = $rtTPG->assetsUrl . 'vendor/select2/select2-bootstrap.css';
95
+ $styles['rt-tpg-admin'] = $rtTPG->assetsUrl . 'css/admin.css';
96
+ }
97
+
98
+ $version = (defined('WP_DEBUG') && WP_DEBUG) ? time() : $rtTPG->options['version'];
99
+ foreach ($scripts as $script) {
100
+ wp_register_script($script['handle'], $script['src'], $script['deps'], $version,
101
+ $script['footer']);
102
+ }
103
+
104
+
105
+ foreach ($styles as $k => $v) {
106
+ wp_register_style($k, $v, false, $version);
107
+ }
108
+ }
109
+
110
+ function admin_menu() {
111
+ global $rtTPG;
112
+ add_submenu_page('edit.php?post_type=' . $rtTPG->post_type, __('Settings', "the-post-grid"), __('Settings', "the-post-grid"),
113
+ 'administrator', 'rttpg_settings', array($this, 'rttpg_settings'));
114
+ }
115
+
116
+ function rttpg_settings() {
117
+ global $rtTPG;
118
+ $rtTPG->render('settings.settings');
119
+ }
120
+
121
+ public function the_post_grid_load_text_domain() {
122
+ load_plugin_textdomain('the-post-grid', false, RT_THE_POST_GRID_LANGUAGE_PATH);
123
+ }
124
+
125
+ function activate() {
126
+ $this->insertDefaultData();
127
+ }
128
+
129
+ function deactivate() {
130
+
131
+ }
132
+
133
+ private function insertDefaultData() {
134
+ global $rtTPG;
135
+ update_option($rtTPG->options['installed_version'], $rtTPG->options['version']);
136
+ if (!get_option($rtTPG->options['settings'])) {
137
+ update_option($rtTPG->options['settings'], $rtTPG->defaultSettings);
138
+ }
139
+ }
140
+
141
+ function rt_post_grid_marketing($links) {
142
+ $links[] = '<a target="_blank" href="' . esc_url('http://demo.radiustheme.com/wordpress/plugins/the-post-grid/') . '">Demo</a>';
143
+ $links[] = '<a target="_blank" href="' . esc_url('https://www.radiustheme.com/how-to-setup-configure-the-post-grid-free-version-for-wordpress/') . '">Documentation</a>';
144
+ $links[] = '<a target="_blank" style="color: #39b54a;font-weight: 700;" href="' . esc_url('https://www.radiustheme.com/the-post-grid-pro-for-wordpress/') . '">Get Pro</a>';
145
+
146
+ return $links;
147
+ }
148
+
149
+
150
+ function settings_admin_enqueue_scripts() {
151
+ global $pagenow, $typenow, $rtTPG;
152
+
153
+ // validate page
154
+ if (!in_array($pagenow, array('edit.php'))) {
155
+ return;
156
+ }
157
+ if ($typenow != $rtTPG->post_type) {
158
+ return;
159
+ }
160
+
161
+ wp_enqueue_script(array(
162
+ 'jquery',
163
+ 'rt-select2-js',
164
+ 'rt-tpg-admin',
165
+ ));
166
+
167
+ // styles
168
+ wp_enqueue_style(array(
169
+ 'rt-select2-css',
170
+ 'rt-tpg-admin',
171
+ ));
172
+
173
+ $nonce = wp_create_nonce($rtTPG->nonceText());
174
+ wp_localize_script('rt-tpg-admin', 'rttpg',
175
+ array(
176
+ 'nonceID' => $rtTPG->nonceId(),
177
+ 'nonce' => $nonce,
178
+ 'ajaxurl' => admin_url('admin-ajax.php')
179
+ ));
180
+ }
181
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
182
  endif;
lib/classes/rtTPGMeta.php CHANGED
@@ -1,53 +1,61 @@
1
  <?php
2
 
3
- if(!class_exists('rtTPGMeta')):
4
 
5
  class rtTPGMeta
6
  {
7
- function __construct()
8
- {
9
  // actions
10
- add_action('admin_head', array($this,'admin_head'));
11
- add_action('admin_enqueue_scripts', array($this, 'admin_enqueue_scripts'));
12
  add_action('save_post', array($this, 'save_post'), 10, 2);
13
- add_filter( 'manage_edit-rttpg_columns', array($this, 'arrange_rttpg_columns'));
14
- add_action( 'manage_rttpg_posts_custom_column', array($this,'manage_rttpg_columns'), 10, 2);
15
  }
16
- public function manage_rttpg_columns( $column ) {
17
- switch ( $column ) {
 
18
  case 'shortcode':
19
- echo '<input type="text" onfocus="this.select();" readonly="readonly" value="[the-post-grid id=&quot;'.get_the_ID().'&quot; title=&quot;'.get_the_title().'&quot;]" class="large-text code rt-code-sc">';
20
  break;
21
  default:
22
  break;
23
  }
24
  }
25
 
26
- function arrange_rttpg_columns($columns){
27
- $shortcode = array( 'shortcode' => __( 'Shortcode', 'the-post-grid' ) );
28
- return array_slice( $columns, 0, 2, true ) + $shortcode + array_slice( $columns, 1, null, true );
 
29
  }
30
 
31
- function admin_enqueue_scripts()
32
- {
33
- global $pagenow, $typenow, $rtTPG;
34
 
35
  // validate page
36
- if( !in_array( $pagenow, array('post.php', 'post-new.php') ) ) return;
37
- if( $typenow != $rtTPG->post_type ) return;
 
 
 
 
38
 
39
 
40
- wp_dequeue_script( 'autosave' );
41
 
42
  // scripts
43
  wp_enqueue_script(array(
44
  'jquery',
 
45
  'jquery-ui-core',
 
 
46
  'jquery-ui-tabs',
47
  'wp-color-picker',
48
  'ace_code_highlighter_js',
49
  'ace_mode_js',
50
  'rt-select2-js',
 
51
  'rt-tpg-admin',
52
  ));
53
 
@@ -56,122 +64,144 @@ if(!class_exists('rtTPGMeta')):
56
  'wp-color-picker',
57
  'rt-select2-css',
58
  'rt-select2-bootstrap-css',
59
- 'rt-tpg-admin',
 
 
60
  ));
61
 
62
- $nonce = wp_create_nonce( $rtTPG->nonceText() );
63
- wp_localize_script( 'rt-tpg-admin', 'rttpg',
64
  array(
65
- 'nonceID' => $rtTPG->nonceId(),
66
- 'nonce' => $nonce,
67
- 'ajaxurl' => admin_url( 'admin-ajax.php' )
68
- ) );
69
 
70
  }
71
 
72
- function admin_head(){
73
- global $rtTPG;
74
  add_meta_box(
75
  'rttpg_meta',
76
  __('Short Code Generator'),
77
- array($this,'rttpg_meta_settings_selection'),
78
- $rtTPG->post_type,
79
  'normal',
80
  'high');
81
  add_meta_box(
82
  'rttpg_meta_marketing',
83
  __('Pro Features'),
84
- array($this,'rttpg_meta_marketing_selection'),
85
- $rtTPG->post_type,
86
  'side',
87
  'default');
88
- add_action( 'edit_form_after_title', array($this, 'tpg_sc_after_title') );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
89
  }
90
 
91
- function tpg_sc_after_title($post){
92
- global $rtTPG;
93
- if( $rtTPG->post_type !== $post->post_type) {
94
  return;
95
  }
96
  $html = null;
97
  $html .= '<div class="postbox rt-after-title" style="margin-bottom: 0;"><div class="inside">';
98
- $html .= '<p><input type="text" onfocus="this.select();" readonly="readonly" value="[the-post-grid id=&quot;'.$post->ID.'&quot; title=&quot;'.$post->post_title.'&quot;]" class="large-text code rt-code-sc">
99
- <input type="text" onfocus="this.select();" readonly="readonly" value="&#60;&#63;php echo do_shortcode( &#39;[the-post-grid id=&quot;'.$post->ID.'&quot; title=&quot;'.$post->post_title.'&quot;]&#39; ); &#63;&#62;" class="large-text code rt-code-sc">
100
  </p>';
101
  $html .= '</div></div>';
102
 
103
  echo $html;
104
  }
105
 
106
- function rttpg_meta_settings_selection($post){
107
- global $rtTPG;
108
  $post = array(
109
  'post' => $post
110
  );
111
- wp_nonce_field( $rtTPG->nonceText(), $rtTPG->nonceId() );
112
  $html = null;
113
- $html .='<div id="sc-tabs" class="rt-setting-holder">';
114
- $html .='<ul class="rt-tab-nav">
115
- <li><a href="#sc-post-post-source">'.__('Post Source', 'the-post-grid').'</a></li>
116
- <li><a href="#sc-post-layout-settings">'.__('Layout Settings', 'the-post-grid').'</a></li>
117
- <li><a href="#sc-field-selection">'.__('Field Selection', 'the-post-grid').'</a></li>
118
- <li><a href="#sc-style">'.__('Style', 'the-post-grid').'</a></li>
119
  </ul>';
120
 
121
 
122
- $html .='<div id="sc-post-post-source" class="rt-tab-container">';
123
- $html .= $rtTPG->render('settings.post-source', $post, true);
124
- $html .='</div>';
125
 
126
- $html .='<div id="sc-post-layout-settings" class="rt-tab-container">';
127
- $html .= $rtTPG->render('settings.layout-settings', $post, true);
128
- $html .='</div>';
129
 
130
- $html .='<div id="sc-field-selection" class="rt-tab-container">';
131
- $html .= $rtTPG->render('settings.item-fields', $post, true);
132
- $html .='</div>';
133
 
134
- $html .='<div id="sc-style" class="rt-tab-container">';
135
- $html .= $rtTPG->render('settings.style', $post, true);
136
- $html .='</div>';
137
 
138
- $html .='</div>';
139
  echo $html;
140
  }
141
 
142
- function rttpg_meta_marketing_selection(){
143
- global $rtTPG;
144
- $html = null;
145
- $html .= "<div class='rt-meta-wrap'>";
146
- $html .= $rtTPG->get_pro_feature_list();
147
- $html .= '<p><a href="https://www.radiustheme.com/the-post-grid-pro-for-wordpress/" class="button-link"
148
  target="_blank">Get Pro Version</a></p>';
149
- $html .= "</div>";
150
 
151
- echo $html;
152
  }
153
 
154
 
155
- function save_post($post_id, $post){
156
 
157
- if( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) return $post_id;
158
- global $rtTPG;
159
- if( !$rtTPG->verifyNonce() ) return $post_id;
 
 
 
160
 
161
- if ($rtTPG->post_type != $post->post_type) return $post_id;
 
 
162
 
163
- foreach($rtTPG->rtAllOptionFields() as $field){
164
- if(isset($field['multiple'])){
165
- if($field['multiple']){
166
  delete_post_meta($post_id, $field['name']);
167
  $mValueA = isset($_REQUEST[$field['name']]) ? $_REQUEST[$field['name']] : array();
168
- if(is_array($mValueA) && !empty($mValueA)){
169
- foreach($mValueA as $item){
170
  add_post_meta($post_id, $field['name'], trim($item));
171
  }
172
  }
173
  }
174
- }else{
175
  $fValue = isset($_REQUEST[$field['name']]) ? trim($_REQUEST[$field['name']]) : null;
176
  update_post_meta($post_id, $field['name'], $fValue);
177
  }
@@ -180,69 +210,69 @@ if(!class_exists('rtTPGMeta')):
180
 
181
  //$opts = ;
182
  $post_filter = (isset($_REQUEST['post_filter']) ? $_REQUEST['post_filter'] : array());
183
- $advFilter = $rtTPG->rtTPAdvanceFilters();
184
- foreach($advFilter['options'] as $filter => $fValue){
185
- if($filter == 'tpg_taxonomy'){
186
  delete_post_meta($post_id, $filter);
187
- if(!empty($_REQUEST[$filter]) && is_array($_REQUEST[$filter])){
188
- foreach($_REQUEST[$filter] as $tax){
189
- if(in_array($filter, $post_filter)){
190
  add_post_meta($post_id, $filter, trim($tax));
191
  }
192
- delete_post_meta($post_id, 'term_'.$tax);
193
- $tt = isset($_REQUEST['term_'.$tax]) ? $_REQUEST['term_'.$tax] : array();
194
- if(is_array($tt) && !empty($tt) && in_array($filter, $post_filter)){
195
- foreach($tt as $termID){
196
- add_post_meta($post_id, 'term_'.$tax, trim($termID));
197
  }
198
  }
199
- $tto = isset($_REQUEST['term_operator_'.$tax]) ? $_REQUEST['term_operator_'.$tax] : null;
200
- if($tto){
201
- update_post_meta($post_id, 'term_operator_'.$tax, trim($tto));
202
  }
203
  }
204
  $filterCount = isset($_REQUEST[$filter]) ? $_REQUEST[$filter] : array();
205
  $tr = isset($_REQUEST['taxonomy_relation']) ? $_REQUEST['taxonomy_relation'] : null;
206
- if(count($filterCount) > 1 && $tr){
207
- update_post_meta($post_id, 'taxonomy_relation', trim($tr));
208
- }else{
209
- delete_post_meta($post_id, 'taxonomy_relation');
210
- }
211
 
212
  }
213
- }else if($filter == 'author'){
214
  delete_post_meta($post_id, 'author');
215
  $authors = isset($_REQUEST['author']) ? $_REQUEST['author'] : array();
216
- if(is_array($authors) && !empty($authors) && in_array('author', $post_filter)){
217
- foreach($authors as $authorID){
218
  add_post_meta($post_id, 'author', trim($authorID));
219
  }
220
  }
221
- }else if($filter == 'tpg_post_status'){
222
  delete_post_meta($post_id, $filter);
223
  $statuses = isset($_REQUEST[$filter]) ? $_REQUEST[$filter] : array();
224
- if(is_array($statuses) && !empty($statuses) && in_array($filter, $post_filter)){
225
- foreach($statuses as $post_status){
226
  add_post_meta($post_id, $filter, trim($post_status));
227
  }
228
  }
229
- }else if($filter == 's'){
230
  delete_post_meta($post_id, 's');
231
  $s = isset($_REQUEST['s']) ? $_REQUEST['s'] : null;
232
- if($s && in_array('s', $post_filter)){
233
  update_post_meta($post_id, 's', sanitize_text_field(trim($s)));
234
  }
235
- }else if($filter == 'order'){
236
- if(in_array('order', $post_filter)){
237
  $order = isset($_REQUEST['order']) ? $_REQUEST['order'] : null;
238
- if($order && in_array('order', $post_filter)){
239
  update_post_meta($post_id, 'order', sanitize_text_field(trim($order)));
240
  }
241
  $order_by = isset($_REQUEST['order_by']) ? $_REQUEST['order_by'] : null;
242
- if($order_by && in_array('order', $post_filter)){
243
  update_post_meta($post_id, 'order_by', sanitize_text_field(trim($order_by)));
244
  }
245
- }else{
246
  delete_post_meta($post_id, 'order');
247
  delete_post_meta($post_id, 'order_by');
248
  }
1
  <?php
2
 
3
+ if (!class_exists('rtTPGMeta')):
4
 
5
  class rtTPGMeta
6
  {
7
+ function __construct() {
 
8
  // actions
9
+ add_action('admin_head', array($this, 'admin_head'));
10
+ add_action('admin_enqueue_scripts', array($this, 'admin_enqueue_scripts'));
11
  add_action('save_post', array($this, 'save_post'), 10, 2);
12
+ add_filter('manage_edit-rttpg_columns', array($this, 'arrange_rttpg_columns'));
13
+ add_action('manage_rttpg_posts_custom_column', array($this, 'manage_rttpg_columns'), 10, 2);
14
  }
15
+
16
+ public function manage_rttpg_columns($column) {
17
+ switch ($column) {
18
  case 'shortcode':
19
+ echo '<input type="text" onfocus="this.select();" readonly="readonly" value="[the-post-grid id=&quot;' . get_the_ID() . '&quot; title=&quot;' . get_the_title() . '&quot;]" class="large-text code rt-code-sc">';
20
  break;
21
  default:
22
  break;
23
  }
24
  }
25
 
26
+ function arrange_rttpg_columns($columns) {
27
+ $shortcode = array('shortcode' => __('Shortcode', 'the-post-grid'));
28
+
29
+ return array_slice($columns, 0, 2, true) + $shortcode + array_slice($columns, 1, null, true);
30
  }
31
 
32
+ function admin_enqueue_scripts() {
33
+ global $pagenow, $typenow;
 
34
 
35
  // validate page
36
+ if (!in_array($pagenow, array('post.php', 'post-new.php'))) {
37
+ return;
38
+ }
39
+ if ($typenow != rtTPG()->post_type) {
40
+ return;
41
+ }
42
 
43
 
44
+ wp_dequeue_script('autosave');
45
 
46
  // scripts
47
  wp_enqueue_script(array(
48
  'jquery',
49
+ 'rt-isotope-js',
50
  'jquery-ui-core',
51
+ 'rt-fontawsome',
52
+ 'rt-actual-height-js',
53
  'jquery-ui-tabs',
54
  'wp-color-picker',
55
  'ace_code_highlighter_js',
56
  'ace_mode_js',
57
  'rt-select2-js',
58
+ 'rt-tpg',
59
  'rt-tpg-admin',
60
  ));
61
 
64
  'wp-color-picker',
65
  'rt-select2-css',
66
  'rt-select2-bootstrap-css',
67
+ 'rt-tpg',
68
+ 'rt-fontawsome',
69
+ 'rt-tpg-admin'
70
  ));
71
 
72
+ $nonce = wp_create_nonce(rtTPG()->nonceText());
73
+ wp_localize_script('rt-tpg-admin', 'rttpg',
74
  array(
75
+ 'nonceID' => rtTPG()->nonceId(),
76
+ 'nonce' => $nonce,
77
+ 'ajaxurl' => admin_url('admin-ajax.php')
78
+ ));
79
 
80
  }
81
 
82
+ function admin_head() {
 
83
  add_meta_box(
84
  'rttpg_meta',
85
  __('Short Code Generator'),
86
+ array($this, 'rttpg_meta_settings_selection'),
87
+ rtTPG()->post_type,
88
  'normal',
89
  'high');
90
  add_meta_box(
91
  'rttpg_meta_marketing',
92
  __('Pro Features'),
93
+ array($this, 'rttpg_meta_marketing_selection'),
94
+ rtTPG()->post_type,
95
  'side',
96
  'default');
97
+ add_meta_box(
98
+ rtTPG()->post_type . '_sc_preview_meta',
99
+ __('Layout Preview', 'the-post-grid'),
100
+ array($this, 'tpg_sc_preview_selection'),
101
+ rtTPG()->post_type,
102
+ 'normal',
103
+ 'high');
104
+ add_action('edit_form_after_title', array($this, 'tpg_sc_after_title'));
105
+ }
106
+
107
+
108
+ /**
109
+ * Preview section
110
+ */
111
+ function tpg_sc_preview_selection() {
112
+ $html = null;
113
+ $html .= "<div class='rt-response'></div>";
114
+ $html .= "<div id='tpg-preview-container'></div>";
115
+ echo $html;
116
+
117
  }
118
 
119
+ function tpg_sc_after_title($post) {
120
+ if (rtTPG()->post_type !== $post->post_type) {
 
121
  return;
122
  }
123
  $html = null;
124
  $html .= '<div class="postbox rt-after-title" style="margin-bottom: 0;"><div class="inside">';
125
+ $html .= '<p><input type="text" onfocus="this.select();" readonly="readonly" value="[the-post-grid id=&quot;' . $post->ID . '&quot; title=&quot;' . $post->post_title . '&quot;]" class="large-text code rt-code-sc">
126
+ <input type="text" onfocus="this.select();" readonly="readonly" value="&#60;&#63;php echo do_shortcode( &#39;[the-post-grid id=&quot;' . $post->ID . '&quot; title=&quot;' . $post->post_title . '&quot;]&#39; ); &#63;&#62;" class="large-text code rt-code-sc">
127
  </p>';
128
  $html .= '</div></div>';
129
 
130
  echo $html;
131
  }
132
 
133
+ function rttpg_meta_settings_selection($post) {
 
134
  $post = array(
135
  'post' => $post
136
  );
137
+ wp_nonce_field(rtTPG()->nonceText(), rtTPG()->nonceId());
138
  $html = null;
139
+ $html .= '<div id="sc-tabs" class="rt-setting-holder">';
140
+ $html .= '<ul class="rt-tab-nav">
141
+ <li><a href="#sc-post-post-source">' . __('Post Source', 'the-post-grid') . '</a></li>
142
+ <li><a href="#sc-post-layout-settings">' . __('Layout Settings', 'the-post-grid') . '</a></li>
143
+ <li><a href="#sc-field-selection">' . __('Field Selection', 'the-post-grid') . '</a></li>
144
+ <li><a href="#sc-style">' . __('Style', 'the-post-grid') . '</a></li>
145
  </ul>';
146
 
147
 
148
+ $html .= '<div id="sc-post-post-source" class="rt-tab-container">';
149
+ $html .= rtTPG()->render('settings.post-source', $post, true);
150
+ $html .= '</div>';
151
 
152
+ $html .= '<div id="sc-post-layout-settings" class="rt-tab-container">';
153
+ $html .= rtTPG()->render('settings.layout-settings', $post, true);
154
+ $html .= '</div>';
155
 
156
+ $html .= '<div id="sc-field-selection" class="rt-tab-container">';
157
+ $html .= rtTPG()->render('settings.item-fields', $post, true);
158
+ $html .= '</div>';
159
 
160
+ $html .= '<div id="sc-style" class="rt-tab-container">';
161
+ $html .= rtTPG()->render('settings.style', $post, true);
162
+ $html .= '</div>';
163
 
164
+ $html .= '</div>';
165
  echo $html;
166
  }
167
 
168
+ function rttpg_meta_marketing_selection() {
169
+ $html = null;
170
+ $html .= "<div class='rt-meta-wrap'>";
171
+ $html .= rtTPG()->get_pro_feature_list();
172
+ $html .= '<p><a href="https://www.radiustheme.com/the-post-grid-pro-for-wordpress/" class="button-link"
 
173
  target="_blank">Get Pro Version</a></p>';
174
+ $html .= "</div>";
175
 
176
+ echo $html;
177
  }
178
 
179
 
180
+ function save_post($post_id, $post) {
181
 
182
+ if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
183
+ return $post_id;
184
+ }
185
+ if (!rtTPG()->verifyNonce()) {
186
+ return $post_id;
187
+ }
188
 
189
+ if (rtTPG()->post_type != $post->post_type) {
190
+ return $post_id;
191
+ }
192
 
193
+ foreach (rtTPG()->rtAllOptionFields() as $field) {
194
+ if (isset($field['multiple'])) {
195
+ if ($field['multiple']) {
196
  delete_post_meta($post_id, $field['name']);
197
  $mValueA = isset($_REQUEST[$field['name']]) ? $_REQUEST[$field['name']] : array();
198
+ if (is_array($mValueA) && !empty($mValueA)) {
199
+ foreach ($mValueA as $item) {
200
  add_post_meta($post_id, $field['name'], trim($item));
201
  }
202
  }
203
  }
204
+ } else {
205
  $fValue = isset($_REQUEST[$field['name']]) ? trim($_REQUEST[$field['name']]) : null;
206
  update_post_meta($post_id, $field['name'], $fValue);
207
  }
210
 
211
  //$opts = ;
212
  $post_filter = (isset($_REQUEST['post_filter']) ? $_REQUEST['post_filter'] : array());
213
+ $advFilter = rtTPG()->rtTPAdvanceFilters();
214
+ foreach ($advFilter['options'] as $filter => $fValue) {
215
+ if ($filter == 'tpg_taxonomy') {
216
  delete_post_meta($post_id, $filter);
217
+ if (!empty($_REQUEST[$filter]) && is_array($_REQUEST[$filter])) {
218
+ foreach ($_REQUEST[$filter] as $tax) {
219
+ if (in_array($filter, $post_filter)) {
220
  add_post_meta($post_id, $filter, trim($tax));
221
  }
222
+ delete_post_meta($post_id, 'term_' . $tax);
223
+ $tt = isset($_REQUEST['term_' . $tax]) ? $_REQUEST['term_' . $tax] : array();
224
+ if (is_array($tt) && !empty($tt) && in_array($filter, $post_filter)) {
225
+ foreach ($tt as $termID) {
226
+ add_post_meta($post_id, 'term_' . $tax, trim($termID));
227
  }
228
  }
229
+ $tto = isset($_REQUEST['term_operator_' . $tax]) ? $_REQUEST['term_operator_' . $tax] : null;
230
+ if ($tto) {
231
+ update_post_meta($post_id, 'term_operator_' . $tax, trim($tto));
232
  }
233
  }
234
  $filterCount = isset($_REQUEST[$filter]) ? $_REQUEST[$filter] : array();
235
  $tr = isset($_REQUEST['taxonomy_relation']) ? $_REQUEST['taxonomy_relation'] : null;
236
+ if (count($filterCount) > 1 && $tr) {
237
+ update_post_meta($post_id, 'taxonomy_relation', trim($tr));
238
+ } else {
239
+ delete_post_meta($post_id, 'taxonomy_relation');
240
+ }
241
 
242
  }
243
+ } else if ($filter == 'author') {
244
  delete_post_meta($post_id, 'author');
245
  $authors = isset($_REQUEST['author']) ? $_REQUEST['author'] : array();
246
+ if (is_array($authors) && !empty($authors) && in_array('author', $post_filter)) {
247
+ foreach ($authors as $authorID) {
248
  add_post_meta($post_id, 'author', trim($authorID));
249
  }
250
  }
251
+ } else if ($filter == 'tpg_post_status') {
252
  delete_post_meta($post_id, $filter);
253
  $statuses = isset($_REQUEST[$filter]) ? $_REQUEST[$filter] : array();
254
+ if (is_array($statuses) && !empty($statuses) && in_array($filter, $post_filter)) {
255
+ foreach ($statuses as $post_status) {
256
  add_post_meta($post_id, $filter, trim($post_status));
257
  }
258
  }
259
+ } else if ($filter == 's') {
260
  delete_post_meta($post_id, 's');
261
  $s = isset($_REQUEST['s']) ? $_REQUEST['s'] : null;
262
+ if ($s && in_array('s', $post_filter)) {
263
  update_post_meta($post_id, 's', sanitize_text_field(trim($s)));
264
  }
265
+ } else if ($filter == 'order') {
266
+ if (in_array('order', $post_filter)) {
267
  $order = isset($_REQUEST['order']) ? $_REQUEST['order'] : null;
268
+ if ($order && in_array('order', $post_filter)) {
269
  update_post_meta($post_id, 'order', sanitize_text_field(trim($order)));
270
  }
271
  $order_by = isset($_REQUEST['order_by']) ? $_REQUEST['order_by'] : null;
272
+ if ($order_by && in_array('order', $post_filter)) {
273
  update_post_meta($post_id, 'order_by', sanitize_text_field(trim($order_by)));
274
  }
275
+ } else {
276
  delete_post_meta($post_id, 'order');
277
  delete_post_meta($post_id, 'order_by');
278
  }
lib/classes/rtTPGOptions.php CHANGED
@@ -1,427 +1,468 @@
1
  <?php
2
 
3
- if ( ! class_exists( 'rtTPGOptions' ) ):
4
 
5
- class rtTPGOptions {
 
6
 
7
- function rtPostTypes() {
8
- $post_types = get_post_types(
9
- array(
10
- '_builtin' => true
11
- )
12
- );
13
- $exclude = array( 'attachment', 'revision', 'nav_menu_item' );
14
- foreach ( $exclude as $ex ) {
15
- unset( $post_types[ $ex ] );
16
- }
17
 
18
- return $post_types;
19
- }
20
 
21
- function rtPostOrders() {
22
- return array(
23
- "ASC" => "Ascending",
24
- "DESC" => "Descending",
25
- );
26
- }
27
 
28
- function rtTermOperators() {
29
- return array(
30
- 'IN' => "IN — show posts which associate with one or more of selected terms",
31
- 'NOT IN' => "NOT IN — show posts which do not associate with any of selected terms",
32
- 'AND' => "AND — show posts which associate with all of selected terms",
33
- );
34
- }
35
 
36
- function rtTermRelations() {
37
- return array(
38
- 'AND' => "AND — show posts which match all settings",
39
- 'OR' => "OR — show posts which match one or more settings",
40
- );
41
- }
42
 
43
- function rtPostOrderBy() {
44
- return array(
45
- "ID" => "ID",
46
- "title" => "Title",
47
- "date" => "Created date",
48
- "modified" => "Modified date",
49
- "menu_order" => "Menu Order"
50
- );
51
- }
52
 
53
- function rtTPGSettingFields() {
54
- global $rtTPG;
55
- $settings = get_option( $rtTPG->options['settings'] );
56
 
57
- return array(
58
- 'custom_css' => array(
59
- 'type' => 'textarea',
60
- 'name' => 'custom_css',
61
- 'label' => 'Custom Css',
62
- 'holderClass' => 'rt-script-wrapper full',
63
- 'id' => 'custom-css',
64
- 'value' => isset( $settings['custom_css'] ) ? stripslashes( $settings['custom_css'] ) : null,
65
- ),
66
- "script_before_item_load" => array(
67
- 'name' => 'script_before_item_load',
68
- "label" => __( "Script before item load", 'the-post-grid' ),
69
- 'type' => 'textarea',
70
- 'holderClass' => 'rt-script-wrapper full',
71
- 'id' => 'script-before-item-load',
72
- 'value' => isset( $settings['script_before_item_load'] ) ? stripslashes( $settings['script_before_item_load'] ) : null
73
- ),
74
- "script_after_item_load" => array(
75
- 'name' => 'script_after_item_load',
76
- "label" => __( "Script After item load", 'the-post-grid' ),
77
- 'type' => 'textarea',
78
- 'holderClass' => 'rt-script-wrapper full',
79
- 'id' => 'script-after-item-load',
80
- 'value' => isset( $settings['script_after_item_load'] ) ? stripslashes( $settings['script_after_item_load'] ) : null
81
- ),
82
- "script_loaded" => array(
83
- 'name' => 'script_loaded',
84
- "label" => __( "After Loaded Script", 'the-post-grid' ),
85
- 'type' => 'textarea',
86
- 'holderClass' => 'rt-script-wrapper full',
87
- 'id' => 'script-loaded',
88
- 'value' => isset( $settings['script_loaded'] ) ? stripslashes( $settings['script_loaded'] ) : null
89
- )
90
- );
91
- }
92
 
93
- function rtTPGCommonFilterFields() {
94
- return array(
95
- 'post__in' => array(
96
- "name" => "post__in",
97
- "label" => "Include only",
98
- "type" => "text",
99
- "class" => "full",
100
- "description" => __( 'List of post IDs to show (comma-separated values, for example: 1,2,3)',
101
- 'the-post-grid' )
102
- ),
103
- 'post__not_in' => array(
104
- "name" => "post__not_in",
105
- "label" => "Exclude",
106
- "type" => "text",
107
- "class" => "full",
108
- "description" => __( 'List of post IDs to hide (comma-separated values, for example: 1,2,3)',
109
- 'the-post-grid' )
110
- ),
111
- 'limit' => array(
112
- "name" => "limit",
113
- "label" => "Limit",
114
- "type" => "number",
115
- "class" => "full",
116
- "description" => __( 'The number of posts to show. Set empty to show all found posts.',
117
- 'the-post-grid' )
118
- )
119
- );
120
- }
121
 
122
- function rtTPGPostType() {
123
- return array(
124
- "name" => "tpg_post_type",
125
- "label" => "Post Type",
126
- "type" => "select",
127
- "id" => "rc-sc-post-type",
128
- "class" => "rt-select2",
129
- "options" => $this->rtPostTypes()
130
- );
131
- }
132
 
133
- function rtTPAdvanceFilters() {
134
- return array(
135
- 'type' => "checkbox",
136
- 'name' => "post_filter",
137
- 'label' => "Advanced filters",
138
- 'id' => "post_filter",
139
- "alignment" => "vertical",
140
- "multiple" => true,
141
- "options" => array(
142
- 'tpg_taxonomy' => "Taxonomy",
143
- 'order' => "Order",
144
- 'author' => "Author",
145
- 'tpg_post_status' => "Status",
146
- 's' => "Search"
147
- ),
148
- );
149
- }
150
 
151
- function rtTPGPostStatus() {
152
- return array(
153
- 'publish' => 'Publish',
154
- 'pending' => 'Pending',
155
- 'draft' => 'Draft',
156
- 'auto-draft' => 'Auto draft',
157
- 'future' => 'Future',
158
- 'private' => 'Private',
159
- 'inherit' => 'Inherit',
160
- 'trash' => 'Trash',
161
- );
162
- }
163
 
164
- function rtTPGLayoutSettingFields() {
165
- global $rtTPG;
166
 
167
- return array(
168
- 'layout' => array(
169
- "type" => "select",
170
- "name" => "layout",
171
- "label" => "Layout",
172
- "id" => "rt-tpg-sc-layout",
173
- "class" => "rt-select2",
174
- "options" => $this->rtTPGLayouts()
175
- ),
176
- 'isotope-filtering' => array(
177
- "type" => "select",
178
- "name" => "isotope_filter",
179
- "label" => "Isotope Filter",
180
- 'holderClass' => "sc-isotope-filter tpg-hidden",
181
- "id" => "rt-tpg-sc-isotope-filter",
182
- "class" => "rt-select2",
183
- "options" => $rtTPG->rt_get_taxonomy_for_isotope_filter()
184
- ),
185
- 'tgp_layout2_image_column' => array(
186
- 'type' => 'select',
187
- "name" => "tgp_layout2_image_column",
188
- "id" => "tgp_layout2_image_column",
189
- 'label' => __( 'Image column', 'the-post-grid' ),
190
- 'class' => 'rt-select2',
191
- 'holderClass' => "holder-layout2-image-column tpg-hidden",
192
- 'default' => 4,
193
- 'options' => $this->rtTPGColumns(),
194
- "description" => "Content column will calculate automatically"
195
- ),
196
- 'column' => array(
197
- "type" => "select",
198
- "name" => "column",
199
- "label" => "Column",
200
- "id" => "rt-column",
201
- "class" => "rt-select2",
202
- "default" => 4,
203
- "options" => $this->rtTPGColumns()
204
- ),
205
- 'pagination' => array(
206
- "type" => "checkbox",
207
- "name" => "pagination",
208
- "label" => "Pagination",
209
- 'holderClass' => "pagination",
210
- "id" => "rt-tpg-pagination",
211
- "option" => 'Enable'
212
- ),
213
- 'posts_per_page' => array(
214
- "type" => "number",
215
- "name" => "posts_per_page",
216
- "label" => "Display per page",
217
- 'holderClass' => "posts-per-page tpg-hidden",
218
- "id" => "posts-per-page",
219
- "default" => 5,
220
- "description" => __( "If value of Limit setting is not blank (empty), this value should be smaller than Limit value.",
221
- 'the-post-grid' )
222
- ),
223
- 'featured_image' => array(
224
- "type" => "checkbox",
225
- "name" => "featured_image",
226
- "label" => "Feature Image",
227
- "id" => "rt-feature-image",
228
- "option" => 'Disable'
229
- ),
230
- 'featured_image_size' => array(
231
- "type" => "select",
232
- "name" => "featured_image_size",
233
- "label" => "Feature Image Size",
234
- "id" => "featured-image-size",
235
- 'holderClass' => "feature-image-options tpg-hidden",
236
- "class" => "rt-select2",
237
- "options" => $rtTPG->get_image_sizes()
238
- ),
239
- 'media_source' => array(
240
- "type" => "radio",
241
- "name" => "media_source",
242
- "label" => "Media Source",
243
- "id" => "media-source",
244
- 'holderClass' => "feature-image-options tpg-hidden",
245
- "default" => 'feature_image',
246
- "alignment" => "vertical",
247
- "options" => $this->rtMediaSource()
248
- ),
249
- 'tgp_excerpt_type' => array(
250
- "type" => "radio",
251
- "label" => "Excerpt Type",
252
- "name" => "tgp_excerpt_type",
253
- "id" => "tgp_excerpt_type",
254
- "alignment" => "vertical",
255
- "default" => 'character',
256
- "options" => $this->get_excerpt_type(),
257
- ),
258
- 'excerpt_limit' => array(
259
- "type" => "number",
260
- "name" => "excerpt_limit",
261
- "label" => "Excerpt limit",
262
- "id" => "excerpt-limit",
263
- "description" => __( "Excerpt limit only integer number is allowed, Leave it blank for full excerpt. Note: This will remove all html tag",
264
- 'the-post-grid' )
265
- ),
266
- 'tgp_excerpt_more_text' => array(
267
- "type" => "text",
268
- "label" => "Excerpt more text",
269
- "name" => "tgp_excerpt_more_text",
270
- "id" => "tgp_excerpt_more_text",
271
- "default" => "..."
272
- ),
273
- 'tgp_read_more_text' => array(
274
- "type" => "text",
275
- "label" => "Read more text",
276
- "name" => "tgp_read_more_text",
277
- "id" => "tgp_read_more_text",
278
- ),
279
- 'tpg_overlay' => array(
280
- "type" => "checkbox",
281
- "name" => "tpg_overlay",
282
- "label" => "Overlay",
283
- "id" => "tpg_overlay",
284
- "option" => 'Enable'
285
- ),
286
- 'title_tag' => array(
287
- 'type' => 'select',
288
- 'name' => 'title_tag',
289
- 'label' => 'Title tag',
290
- 'class' => 'rt-select2',
291
- 'id' => 'title-tag',
292
- 'options' => $this->getTitleTags(),
293
- 'default' => 'h2'
294
- ),
295
- );
296
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
297
 
298
- function get_excerpt_type() {
299
- return array(
300
- 'character' => "Character",
301
- 'word' => "Word"
302
- );
303
- }
304
 
305
- function rtTPGStyleFields() {
 
306
 
307
- return array(
308
- 'parent_class' => array(
309
- "name" => "parent_class",
310
- "type" => "text",
311
- "label" => "Parent class",
312
- "class" => "medium-text",
313
- "description" => "Parent class for adding custom css"
314
- ),
315
- 'primary_color' => array(
316
- "type" => "text",
317
- "name" => "primary_color",
318
- "label" => "Primary Color",
319
- "id" => "primary-color",
320
- "class" => "rt-color",
321
- "default" => "#0367bf"
322
- ),
323
- 'button_bg_color' => array(
324
- "type" => "text",
325
- "name" => "button_bg_color",
326
- "label" => "Button background color",
327
- "id" => "button-bg-color",
328
- "class" => "rt-color"
329
- ),
330
- 'button_hover_bg_color' => array(
331
- "type" => "text",
332
- "name" => "button_hover_bg_color",
333
- "label" => "Button hover background color",
334
- "id" => "button-hover-bg-color",
335
- "class" => "rt-color"
336
- ),
337
- 'button_active_bg_color' => array(
338
- "type" => "text",
339
- "name" => "button_active_bg_color",
340
- "label" => "Button active background color",
341
- "id" => "button-active-bg-color",
342
- "class" => "rt-color"
343
- ),
344
- 'button_text_bg_color' => array(
345
- "type" => "text",
346
- "name" => "button_text_color",
347
- "label" => "Button text color",
348
- "id" => "button-text-color",
349
- "class" => "rt-color"
350
- ),
351
- 'title_color' => array(
352
- "type" => "text",
353
- "name" => "title_color",
354
- "label" => "Title color",
355
- "id" => "title_color",
356
- "class" => "rt-color"
357
- )
358
- );
359
 
360
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
361
 
362
- function getTitleTags() {
363
- return array(
364
- 'h2' => "H2",
365
- 'h3' => "H3",
366
- 'h4' => "H4"
367
- );
368
- }
369
 
370
- function itemFields() {
371
- return array(
372
- "type" => "checkbox",
373
- "name" => "item_fields",
374
- "label" => "Field selection",
375
- "id" => "item-fields",
376
- "multiple" => true,
377
- "alignment" => "vertical",
378
- "default" => array_keys( $this->rtTPGItemFields() ),
379
- "options" => $this->rtTPGItemFields()
380
- );
381
- }
382
 
383
- function rtMediaSource() {
384
- return array(
385
- "feature_image" => __( "Feature Image", 'the-post-grid' ),
386
- "first_image" => __( "First Image from content", 'the-post-grid' )
387
- );
388
- }
 
 
 
 
 
 
389
 
390
- function rtTPGColumns() {
391
- return array(
392
- 1 => "Column 1",
393
- 2 => "Column 2",
394
- 3 => "Column 3",
395
- 4 => "Column 4",
396
- 5 => "Column 5",
397
- 6 => "Column 6"
398
- );
399
- }
400
 
401
- function rtTPGLayouts() {
402
- $layouts = array(
403
- 'layout1' => "Layout 1",
404
- 'layout2' => "Layout 2",
405
- 'layout3' => "Layout 3",
406
- 'isotope1' => "Isotope Layout"
407
- );
 
 
 
408
 
409
- return apply_filters( 'tpg_layouts', $layouts );
410
- }
 
 
 
 
 
411
 
412
- function rtTPGItemFields() {
413
- return array(
414
- 'title' => __( "Title", 'the-post-grid' ),
415
- 'excerpt' => __( "Excerpt", 'the-post-grid' ),
416
- 'read_more' => __( "Read More", 'the-post-grid' ),
417
- 'post_date' => __( "Post Date", 'the-post-grid' ),
418
- 'author' => __( "Author", 'the-post-grid' ),
419
- 'categories' => __( "Categories", 'the-post-grid' ),
420
- 'tags' => __( "Tags", 'the-post-grid' ),
421
- 'comment_count' => __( "Comment Count", 'the-post-grid' )
422
- );
423
- }
424
 
425
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
426
 
427
  endif;
1
  <?php
2
 
3
+ if (!class_exists('rtTPGOptions')):
4
 
5
+ class rtTPGOptions
6
+ {
7
 
8
+ function rtPostTypes() {
9
+ $post_types = get_post_types(
10
+ array(
11
+ '_builtin' => true
12
+ )
13
+ );
14
+ $exclude = array('attachment', 'revision', 'nav_menu_item');
15
+ foreach ($exclude as $ex) {
16
+ unset($post_types[$ex]);
17
+ }
18
 
19
+ return $post_types;
20
+ }
21
 
22
+ function rtPostOrders() {
23
+ return array(
24
+ "ASC" => "Ascending",
25
+ "DESC" => "Descending",
26
+ );
27
+ }
28
 
29
+ function rtTermOperators() {
30
+ return array(
31
+ 'IN' => "IN — show posts which associate with one or more of selected terms",
32
+ 'NOT IN' => "NOT IN — show posts which do not associate with any of selected terms",
33
+ 'AND' => "AND — show posts which associate with all of selected terms",
34
+ );
35
+ }
36
 
37
+ function rtTermRelations() {
38
+ return array(
39
+ 'AND' => "AND — show posts which match all settings",
40
+ 'OR' => "OR — show posts which match one or more settings",
41
+ );
42
+ }
43
 
44
+ function rtPostOrderBy() {
45
+ return array(
46
+ "ID" => "ID",
47
+ "title" => "Title",
48
+ "date" => "Created date",
49
+ "modified" => "Modified date",
50
+ "menu_order" => "Menu Order"
51
+ );
52
+ }
53
 
54
+ function rtTPGSettingFields() {
55
+ global $rtTPG;
56
+ $settings = get_option($rtTPG->options['settings']);
57
 
58
+ return array(
59
+ 'custom_css' => array(
60
+ 'type' => 'textarea',
61
+ 'name' => 'custom_css',
62
+ 'label' => 'Custom Css',
63
+ 'holderClass' => 'rt-script-wrapper full',
64
+ 'id' => 'custom-css',
65
+ 'value' => isset($settings['custom_css']) ? stripslashes($settings['custom_css']) : null,
66
+ ),
67
+ "script_before_item_load" => array(
68
+ 'name' => 'script_before_item_load',
69
+ "label" => __("Script before item load", 'the-post-grid'),
70
+ 'type' => 'textarea',
71
+ 'holderClass' => 'rt-script-wrapper full',
72
+ 'id' => 'script-before-item-load',
73
+ 'value' => isset($settings['script_before_item_load']) ? stripslashes($settings['script_before_item_load']) : null
74
+ ),
75
+ "script_after_item_load" => array(
76
+ 'name' => 'script_after_item_load',
77
+ "label" => __("Script After item load", 'the-post-grid'),
78
+ 'type' => 'textarea',
79
+ 'holderClass' => 'rt-script-wrapper full',
80
+ 'id' => 'script-after-item-load',
81
+ 'value' => isset($settings['script_after_item_load']) ? stripslashes($settings['script_after_item_load']) : null
82
+ ),
83
+ "script_loaded" => array(
84
+ 'name' => 'script_loaded',
85
+ "label" => __("After Loaded Script", 'the-post-grid'),
86
+ 'type' => 'textarea',
87
+ 'holderClass' => 'rt-script-wrapper full',
88
+ 'id' => 'script-loaded',
89
+ 'value' => isset($settings['script_loaded']) ? stripslashes($settings['script_loaded']) : null
90
+ )
91
+ );
92
+ }
93
 
94
+ function rtTPGCommonFilterFields() {
95
+ return array(
96
+ 'post__in' => array(
97
+ "name" => "post__in",
98
+ "label" => "Include only",
99
+ "type" => "text",
100
+ "class" => "full",
101
+ "description" => __('List of post IDs to show (comma-separated values, for example: 1,2,3)',
102
+ 'the-post-grid')
103
+ ),
104
+ 'post__not_in' => array(
105
+ "name" => "post__not_in",
106
+ "label" => "Exclude",
107
+ "type" => "text",
108
+ "class" => "full",
109
+ "description" => __('List of post IDs to hide (comma-separated values, for example: 1,2,3)',
110
+ 'the-post-grid')
111
+ ),
112
+ 'limit' => array(
113
+ "name" => "limit",
114
+ "label" => "Limit",
115
+ "type" => "number",
116
+ "class" => "full",
117
+ "description" => __('The number of posts to show. Set empty to show all found posts.',
118
+ 'the-post-grid')
119
+ )
120
+ );
121
+ }
122
 
123
+ function rtTPGPostType() {
124
+ return array(
125
+ "name" => "tpg_post_type",
126
+ "label" => "Post Type",
127
+ "type" => "select",
128
+ "id" => "rc-sc-post-type",
129
+ "class" => "rt-select2",
130
+ "options" => $this->rtPostTypes()
131
+ );
132
+ }
133
 
134
+ function rtTPAdvanceFilters() {
135
+ return array(
136
+ 'type' => "checkbox",
137
+ 'name' => "post_filter",
138
+ 'label' => "Advanced filters",
139
+ 'id' => "post_filter",
140
+ "alignment" => "vertical",
141
+ "multiple" => true,
142
+ "options" => array(
143
+ 'tpg_taxonomy' => "Taxonomy",
144
+ 'order' => "Order",
145
+ 'author' => "Author",
146
+ 'tpg_post_status' => "Status",
147
+ 's' => "Search"
148
+ ),
149
+ );
150
+ }
151
 
152
+ function rtTPGPostStatus() {
153
+ return array(
154
+ 'publish' => 'Publish',
155
+ 'pending' => 'Pending',
156
+ 'draft' => 'Draft',
157
+ 'auto-draft' => 'Auto draft',
158
+ 'future' => 'Future',
159
+ 'private' => 'Private',
160
+ 'inherit' => 'Inherit',
161
+ 'trash' => 'Trash',
162
+ );
163
+ }
164
 
165
+ function rtTPGLayoutSettingFields() {
166
+ global $rtTPG;
167
 
168
+ return array(
169
+ 'layout' => array(
170
+ "type" => "select",
171
+ "name" => "layout",
172
+ "label" => "Layout",
173
+ "id" => "rt-tpg-sc-layout",
174
+ "class" => "rt-select2",
175
+ "options" => $this->rtTPGLayouts()
176
+ ),
177
+ 'isotope-filtering' => array(
178
+ "type" => "select",
179
+ "name" => "isotope_filter",
180
+ "label" => "Isotope Filter",
181
+ 'holderClass' => "sc-isotope-filter tpg-hidden",
182
+ "id" => "rt-tpg-sc-isotope-filter",
183
+ "class" => "rt-select2",
184
+ "options" => $rtTPG->rt_get_taxonomy_for_isotope_filter()
185
+ ),
186
+ 'tpg_show_all_text' => array(
187
+ "type" => "text",
188
+ "name" => "tpg_show_all_text",
189
+ 'holderClass' => "sc-isotope-filter tpg-hidden",
190
+ "label" => esc_html__("Show all text", 'the-post-grid'),
191
+ "default" => esc_html__("Show all", 'the-post-grid')
192
+ ),
193
+ 'tgp_layout2_image_column' => array(
194
+ 'type' => 'select',
195
+ "name" => "tgp_layout2_image_column",
196
+ "id" => "tgp_layout2_image_column",
197
+ 'label' => __('Image column', 'the-post-grid'),
198
+ 'class' => 'rt-select2',
199
+ 'holderClass' => "holder-layout2-image-column tpg-hidden",
200
+ 'default' => 4,
201
+ 'options' => $this->rtTPGColumns(),
202
+ "description" => "Content column will calculate automatically"
203
+ ),
204
+ 'column' => array(
205
+ "type" => "select",
206
+ "name" => "column",
207
+ "label" => "Column",
208
+ "id" => "rt-column",
209
+ "class" => "rt-select2",
210
+ "default" => 4,
211
+ "options" => $this->rtTPGColumns()
212
+ ),
213
+ 'pagination' => array(
214
+ "type" => "checkbox",
215
+ "name" => "pagination",
216
+ "label" => "Pagination",
217
+ 'holderClass' => "pagination",
218
+ "id" => "rt-tpg-pagination",
219
+ "option" => 'Enable'
220
+ ),
221
+ 'posts_per_page' => array(
222
+ "type" => "number",
223
+ "name" => "posts_per_page",
224
+ "label" => "Display per page",
225
+ 'holderClass' => "posts-per-page tpg-hidden",
226
+ "id" => "posts-per-page",
227
+ "default" => 5,
228
+ "description" => __("If value of Limit setting is not blank (empty), this value should be smaller than Limit value.",
229
+ 'the-post-grid')
230
+ ),
231
+ 'featured_image' => array(
232
+ "type" => "checkbox",
233
+ "name" => "featured_image",
234
+ "label" => "Feature Image",
235
+ "id" => "rt-feature-image",
236
+ "option" => 'Disable'
237
+ ),
238
+ 'featured_image_size' => array(
239
+ "type" => "select",
240
+ "name" => "featured_image_size",
241
+ "label" => "Feature Image Size",
242
+ "id" => "featured-image-size",
243
+ 'holderClass' => "feature-image-options tpg-hidden",
244
+ "class" => "rt-select2",
245
+ "options" => $rtTPG->get_image_sizes()
246
+ ),
247
+ 'media_source' => array(
248
+ "type" => "radio",
249
+ "name" => "media_source",
250
+ "label" => "Media Source",
251
+ "id" => "media-source",
252
+ 'holderClass' => "feature-image-options tpg-hidden",
253
+ "default" => 'feature_image',
254
+ "alignment" => "vertical",
255
+ "options" => $this->rtMediaSource()
256
+ ),
257
+ 'tpg_title_limit' => array(
258
+ "name" => "tpg_title_limit",
259
+ "id" => "tpg-title-limit",
260
+ "type" => "number",
261
+ "label" => esc_html__("Title limit", 'the-post-grid'),
262
+ "description" => esc_html__("Title limit only integer number is allowed, Leave it blank for full title.", 'the-post-grid')
263
+ ),
264
+ 'tpg_title_limit_type' => array(
265
+ "name" => "tpg_title_limit_type",
266
+ "id" => "tpg-title-limit-type",
267
+ "type" => "radio",
268
+ "label" => esc_html__("Title limit type", 'the-post-grid'),
269
+ "alignment" => "vertical",
270
+ "default" => 'character',
271
+ "options" => $this->get_limit_type(),
272
+ ),
273
+ 'excerpt_limit' => array(
274
+ "type" => "number",
275
+ "name" => "excerpt_limit",
276
+ "label" => esc_html__("Excerpt limit", 'the-post-grid'),
277
+ "id" => "excerpt-limit",
278
+ "description" => __("Excerpt limit only integer number is allowed, Leave it blank for full excerpt. Note: This will remove all html tag",
279
+ 'the-post-grid')
280
+ ),
281
+ 'tgp_excerpt_type' => array(
282
+ "type" => "radio",
283
+ "label" => esc_html__("Excerpt Type", 'the-post-grid'),
284
+ "name" => "tgp_excerpt_type",
285
+ "id" => "tgp_excerpt_type",
286
+ "alignment" => "vertical",
287
+ "default" => 'character',
288
+ "options" => $this->get_limit_type(),
289
+ ),
290
+ 'tgp_excerpt_more_text' => array(
291
+ "type" => "text",
292
+ "label" => esc_html__("Excerpt more text", 'the-post-grid'),
293
+ "name" => "tgp_excerpt_more_text",
294
+ "id" => "tgp_excerpt_more_text",
295
+ "default" => "..."
296
+ ),
297
+ 'tgp_read_more_text' => array(
298
+ "type" => "text",
299
+ "label" => esc_html__("Read more text", 'the-post-grid'),
300
+ "name" => "tgp_read_more_text",
301
+ "id" => "tgp_read_more_text",
302
+ ),
303
+ 'tpg_overlay' => array(
304
+ "type" => "checkbox",
305
+ "name" => "tpg_overlay",
306
+ "label" => esc_html__("Overlay", 'the-post-grid'),
307
+ "id" => "tpg_overlay",
308
+ "option" => 'Enable'
309
+ ),
310
+ 'title_tag' => array(
311
+ 'type' => 'select',
312
+ 'name' => 'title_tag',
313
+ 'label' => esc_html__('Title tag', 'the-post-grid'),
314
+ 'class' => 'rt-select2',
315
+ 'id' => 'title-tag',
316
+ 'options' => $this->getTitleTags(),
317
+ 'default' => 'h2'
318
+ ),
319
+ );
320
+ }
321
 
322
+ function get_limit_type() {
323
+ $types = array(
324
+ 'character' => "Character",
325
+ 'word' => "Word"
326
+ );
 
327
 
328
+ return apply_filters('tpg_limit_type', $types);
329
+ }
330
 
331
+ function rtTPGStyleFields() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
332
 
333
+ return array(
334
+ 'parent_class' => array(
335
+ "name" => "parent_class",
336
+ "type" => "text",
337
+ "label" => "Parent class",
338
+ "class" => "medium-text",
339
+ "description" => "Parent class for adding custom css"
340
+ ),
341
+ 'primary_color' => array(
342
+ "type" => "text",
343
+ "name" => "primary_color",
344
+ "label" => "Primary Color",
345
+ "id" => "primary-color",
346
+ "class" => "rt-color",
347
+ "default" => "#0367bf"
348
+ ),
349
+ 'button_bg_color' => array(
350
+ "type" => "text",
351
+ "name" => "button_bg_color",
352
+ "label" => "Button background color",
353
+ "id" => "button-bg-color",
354
+ "class" => "rt-color"
355
+ ),
356
+ 'button_hover_bg_color' => array(
357
+ "type" => "text",
358
+ "name" => "button_hover_bg_color",
359
+ "label" => "Button hover background color",
360
+ "id" => "button-hover-bg-color",
361
+ "class" => "rt-color"
362
+ ),
363
+ 'button_active_bg_color' => array(
364
+ "type" => "text",
365
+ "name" => "button_active_bg_color",
366
+ "label" => "Button active background color",
367
+ "id" => "button-active-bg-color",
368
+ "class" => "rt-color"
369
+ ),
370
+ 'button_text_bg_color' => array(
371
+ "type" => "text",
372
+ "name" => "button_text_color",
373
+ "label" => "Button text color",
374
+ "id" => "button-text-color",
375
+ "class" => "rt-color"
376
+ ),
377
+ 'title_color' => array(
378
+ "type" => "text",
379
+ "name" => "title_color",
380
+ "label" => esc_html__("Title color", "the-post-grid"),
381
+ "id" => "title_color",
382
+ "class" => "rt-color"
383
+ ),
384
+ 'title_hover_color' => array(
385
+ "type" => "text",
386
+ "name" => "title_hover_color",
387
+ "label" => esc_html__("Title hover color", "the-post-grid"),
388
+ "id" => "title_hover_color",
389
+ "class" => "rt-color"
390
+ ),
391
+ 'tpg_read_more_button_border_radius' => array(
392
+ "type" => "number",
393
+ "name" => "tpg_read_more_button_border_radius",
394
+ "id" => "tpg-read-more-button-border-radius",
395
+ "class" => "small-text",
396
+ "label" => esc_html__("Read more button border radius", "the-post-grid"),
397
+ "description" => esc_html__("Leave it blank for default", 'the-post-grid')
398
+ )
399
+ );
400
 
401
+ }
 
 
 
 
 
 
402
 
403
+ function getTitleTags() {
404
+ return array(
405
+ 'h2' => "H2",
406
+ 'h3' => "H3",
407
+ 'h4' => "H4"
408
+ );
409
+ }
 
 
 
 
 
410
 
411
+ function itemFields() {
412
+ return array(
413
+ "type" => "checkbox",
414
+ "name" => "item_fields",
415
+ "label" => "Field selection",
416
+ "id" => "item-fields",
417
+ "multiple" => true,
418
+ "alignment" => "vertical",
419
+ "default" => array_keys($this->rtTPGItemFields()),
420
+ "options" => $this->rtTPGItemFields()
421
+ );
422
+ }
423
 
424
+ function rtMediaSource() {
425
+ return array(
426
+ "feature_image" => __("Feature Image", 'the-post-grid'),
427
+ "first_image" => __("First Image from content", 'the-post-grid')
428
+ );
429
+ }
 
 
 
 
430
 
431
+ function rtTPGColumns() {
432
+ return array(
433
+ 1 => "Column 1",
434
+ 2 => "Column 2",
435
+ 3 => "Column 3",
436
+ 4 => "Column 4",
437
+ 5 => "Column 5",
438
+ 6 => "Column 6"
439
+ );
440
+ }
441
 
442
+ function rtTPGLayouts() {
443
+ $layouts = array(
444
+ 'layout1' => "Layout 1",
445
+ 'layout2' => "Layout 2",
446
+ 'layout3' => "Layout 3",
447
+ 'isotope1' => "Isotope Layout"
448
+ );
449
 
450
+ return apply_filters('tpg_layouts', $layouts);
451
+ }
 
 
 
 
 
 
 
 
 
 
452
 
453
+ function rtTPGItemFields() {
454
+ return array(
455
+ 'title' => __("Title", 'the-post-grid'),
456
+ 'excerpt' => __("Excerpt", 'the-post-grid'),
457
+ 'read_more' => __("Read More", 'the-post-grid'),
458
+ 'post_date' => __("Post Date", 'the-post-grid'),
459
+ 'author' => __("Author", 'the-post-grid'),
460
+ 'categories' => __("Categories", 'the-post-grid'),
461
+ 'tags' => __("Tags", 'the-post-grid'),
462
+ 'comment_count' => __("Comment Count", 'the-post-grid')
463
+ );
464
+ }
465
+
466
+ }
467
 
468
  endif;
lib/classes/rtTPGShortCode.php CHANGED
@@ -1,384 +1,476 @@
1
  <?php
2
 
3
- if ( ! class_exists( 'rtTPGShortCode' ) ):
4
-
5
- class rtTPGShortCode {
6
-
7
- private $scA = array();
8
-
9
- function __construct() {
10
- add_shortcode( 'the-post-grid', array( $this, 'the_post_grid_short_code' ) );
11
- }
12
-
13
- function register_sc_scripts() {
14
- global $rtTPG;
15
- $iso = false;
16
-
17
- foreach ( $this->scA as $sc ) {
18
- if ( isset( $sc ) && is_array( $sc ) ) {
19
- if ( $sc['isIsotope'] ) {
20
- $iso = true;
21
- }
22
- }
23
- }
24
- if ( count( $this->scA ) ) {
25
- if ( $iso ) {
26
- wp_enqueue_script( 'rt-isotope-js' );
27
- }
28
- wp_enqueue_style( 'rt-fontawsome' );
29
- wp_enqueue_script( 'rt-image-load-js' );
30
- wp_enqueue_script( 'rt-actual-height-js' );
31
- wp_enqueue_script( 'rt-tpg' );
32
- $nonce = wp_create_nonce( $rtTPG->nonceText() );
33
- wp_localize_script( 'rt-tpg', 'rttpg',
34
- array(
35
- 'nonceID' => $rtTPG->nonceId(),
36
- 'nonce' => $nonce,
37
- 'ajaxurl' => admin_url( 'admin-ajax.php' )
38
- ) );
39
- }
40
- }
41
-
42
- function the_post_grid_short_code( $atts, $content = null ) {
43
- $rand = mt_rand();
44
- $layoutID = "rt-tpg-container-" . $rand;
45
- global $rtTPG;
46
- $html = null;
47
- $arg = array();
48
- $atts = shortcode_atts( array(
49
- 'id' => null
50
- ), $atts, 'the-post-grid' );
51
- $scID = $atts['id'];
52
- if ( $scID && ! is_null( get_post( $scID ) ) ) {
53
- $scMeta = get_post_meta( $scID );
54
-
55
- $layout = ( isset( $scMeta['layout'][0] ) ? $scMeta['layout'][0] : 'layout1' );
56
- if ( ! in_array( $layout, array_keys( $rtTPG->rtTPGLayouts() ) ) ) {
57
- $layout = 'layout1';
58
- }
59
- $col = ( isset( $scMeta['column'][0] ) ? intval( $scMeta['column'][0] ) : 4 );
60
- if ( ! in_array( $col, array_keys( $rtTPG->rtTPGColumns() ) ) ) {
61
- $col = 4;
62
- }
63
- $fImg = ( isset( $scMeta['featured_image'][0] ) ? true : false );
64
- $fImgSize = ( isset( $scMeta['featured_image_size'][0] ) ? $scMeta['featured_image_size'][0] : "medium" );
65
- $mediaSource = ( isset( $scMeta['media_source'][0] ) ? $scMeta['media_source'][0] : "feature_image" );
66
- $arg['excerpt_type'] = ( isset( $scMeta['tgp_excerpt_type'][0] ) ? $scMeta['tgp_excerpt_type'][0] : 'character' );
67
- $arg['excerpt_limit'] = ( isset( $scMeta['excerpt_limit'][0] ) ? absint( $scMeta['excerpt_limit'][0] ) : 0 );
68
- $arg['excerpt_more_text'] = ( isset( $scMeta['tgp_excerpt_more_text'][0] ) ? $scMeta['tgp_excerpt_more_text'][0] : null );
69
- $arg['read_more_text'] = ( ! empty( $scMeta['tgp_read_more_text'][0] ) ? $scMeta['tgp_read_more_text'][0] : __( 'Read More',
70
- 'the-post-grid' ) );
71
-
72
-
73
- $isIsotope = preg_match( '/isotope/', $layout );
74
-
75
- /* Argument create */
76
- $args = array();
77
- $itemIdsArgs = array();
78
-
79
-
80
- $postType = ( isset( $scMeta['tpg_post_type'][0] ) ? $scMeta['tpg_post_type'][0] : null );
81
- if ( $postType ) {
82
- $args['post_type'] = $itemIdsArgs['post_type'] = $postType;
83
- }
84
-
85
- // Common filter
86
- /* post__in */
87
- $post__in = ( isset( $scMeta['post__in'][0] ) ? $scMeta['post__in'][0] : null );
88
- if ( $post__in ) {
89
- $post__in = explode( ',', $post__in );
90
- $args['post__in'] = $itemIdsArgs['post__in'] = $post__in;
91
- }
92
- /* post__not_in */
93
- $post__not_in = ( isset( $scMeta['post__not_in'][0] ) ? $scMeta['post__not_in'][0] : null );
94
- if ( $post__not_in ) {
95
- $post__not_in = explode( ',', $post__not_in );
96
- $args['post__not_in'] = $itemIdsArgs['post__not_in'] = $post__not_in;
97
- }
98
-
99
- /* LIMIT */
100
- $limit = ( ! empty( $scMeta['limit'][0] ) ? ( $scMeta['limit'][0] == - 1 ? 10000000 : (int) $scMeta['limit'][0] ) : 10000000 );
101
- $args['posts_per_page'] = $itemIdsArgs['posts_per_page'] = $limit;
102
- $pagination = false;
103
- if ( ! $isIsotope ) {
104
- $pagination = ( isset( $scMeta['pagination'][0] ) ? $scMeta['pagination'][0] : false );
105
- if ( $pagination ) {
106
-
107
- $posts_per_page = ( isset( $scMeta['posts_per_page'][0] ) ? intval( $scMeta['posts_per_page'][0] ) : $limit );
108
- if ( $posts_per_page > $limit ) {
109
- $posts_per_page = $limit;
110
- }
111
- // Set 'posts_per_page' parameter
112
- $args['posts_per_page'] = $posts_per_page;
113
- if ( get_query_var( 'paged' ) ) {
114
- $paged = get_query_var( 'paged' );
115
- } elseif ( get_query_var( 'page' ) ) {
116
- $paged = get_query_var( 'page' );
117
- } else {
118
- $paged = 1;
119
- }
120
- $offset = $posts_per_page * ( (int) $paged - 1 );
121
- $args['paged'] = $paged;
122
-
123
- // Update posts_per_page
124
- if ( intval( $args['posts_per_page'] ) > $limit - $offset ) {
125
- $args['posts_per_page'] = $limit - $offset;
126
- }
127
-
128
- }
129
- }
130
-
131
-
132
- // Advance Filter
133
- $adv_filter = ( isset( $scMeta['post_filter'] ) ? $scMeta['post_filter'] : array() );
134
-
135
- // Taxonomy
136
- $taxQ = array();
137
- if ( in_array( 'tpg_taxonomy', $adv_filter ) && isset( $scMeta['tpg_taxonomy'] ) ) {
138
-
139
- if ( is_array( $scMeta['tpg_taxonomy'] ) && ! empty( $scMeta['tpg_taxonomy'] ) ) {
140
- foreach ( $scMeta['tpg_taxonomy'] as $taxonomy ) {
141
- $terms = ( isset( $scMeta[ 'term_' . $taxonomy ] ) ? $scMeta[ 'term_' . $taxonomy ] : array() );
142
- if ( is_array( $terms ) && ! empty( $terms ) ) {
143
- $operator = ( isset( $scMeta[ 'term_operator_' . $taxonomy ][0] ) ? $scMeta[ 'term_operator_' . $taxonomy ][0] : "IN" );
144
- $taxQ[] = array(
145
- 'taxonomy' => $taxonomy,
146
- 'field' => 'term_id',
147
- 'terms' => $terms,
148
- 'operator' => $operator,
149
- );
150
- }
151
- }
152
- }
153
- if ( count( $taxQ ) >= 2 ) {
154
- $relation = ( isset( $scMeta['taxonomy_relation'][0] ) ? $scMeta['taxonomy_relation'][0] : "AND" );
155
- $taxQ['relation'] = $relation;
156
- }
157
- }
158
-
159
- if ( ! empty( $taxQ ) ) {
160
- $args['tax_query'] = $itemIdsArgs['tax_query'] = $taxQ;
161
- }
162
-
163
- // Order
164
- if ( in_array( 'order', $adv_filter ) ) {
165
- $order_by = ( isset( $scMeta['order_by'][0] ) ? $scMeta['order_by'][0] : null );
166
- $order = ( isset( $scMeta['order'][0] ) ? $scMeta['order'][0] : null );
167
- if ( $order ) {
168
- $args['order'] = $itemIdsArgs['order'] = $order;
169
- }
170
- if ( $order_by ) {
171
- $args['orderby'] = $itemIdsArgs['orderby'] = $order_by;
172
- }
173
- }
174
- // Status
175
- if ( in_array( 'tpg_post_status', $adv_filter ) ) {
176
- $post_status = ( isset( $scMeta['tpg_post_status'] ) ? $scMeta['tpg_post_status'] : array() );
177
- if ( ! empty( $post_status ) ) {
178
- $args['post_status'] = $itemIdsArgs['post_status'] = $post_status;
179
- } else {
180
- $args['post_status'] = $itemIdsArgs['post_status'] = 'publish';
181
- }
182
- }
183
- // Author
184
- $author = ( isset( $scMeta['author'] ) ? $scMeta['author'] : array() );
185
- if ( in_array( 'author', $adv_filter ) && ! empty( $author ) ) {
186
- $args['author__in'] = $itemIdsArgs['author__in'] = $author;
187
- }
188
- // Search
189
- $s = ( isset( $scMeta['s'][0] ) ? $scMeta['s'][0] : array() );
190
- if ( in_array( 's', $adv_filter ) && ! empty( $s ) ) {
191
- $args['s'] = $itemIdsArgs['s'] = $s;
192
- }
193
-
194
- // Validation
195
- if ( ! in_array( $layout, array_keys( $rtTPG->rtTPGLayouts() ) ) ) {
196
- $layout = 'layout1';
197
- }
198
-
199
- if ( ( $layout == 'layout2' ) || ( $layout == 'layout3' ) ) {
200
- $iCol = ( isset( $scMeta['tgp_layout2_image_column'][0] ) ? absint( $scMeta['tgp_layout2_image_column'][0] ) : 4 );
201
- $iCol = $iCol > 12 ? 4 : $iCol;
202
- $cCol = 12 - $iCol;
203
- $arg['image_area'] = "rt-col-sm-{$iCol} rt-col-xs-12 ";
204
- $arg['content_area'] = "rt-col-sm-{$cCol} rt-col-xs-12 ";
205
- }
206
- $col = $col == 5 ? "24" : round( 12 / $col );
207
- if ( ( $layout == 'layout2' ) || ( $layout == 'layout3' ) ) {
208
- $arg['grid'] = "rt-col-lg-{$col} rt-col-md-{$col} rt-col-sm-12 rt-col-xs-12";
209
- } else {
210
- $arg['grid'] = "rt-col-lg-{$col} rt-col-md-{$col} rt-col-sm-6 rt-col-xs-12";
211
- }
212
-
213
-
214
- $arg['class'] = 'rt-equal-height';
215
- if ( $isIsotope ) {
216
- $arg['class'] .= ' isotope-item';
217
- }
218
-
219
- $arg['overlay'] = empty( $scMeta['tpg_overlay'][0] ) ? false : true;
220
- $parentClass = ( ! empty( $scMeta['parent_class'][0] ) ? trim( $scMeta['parent_class'][0] ) : null );
221
- $arg['items'] = isset( $scMeta['item_fields'] ) ? ( $scMeta['item_fields'] ? $scMeta['item_fields'] : array() ) : array();
222
- $arg['title_tag'] = ( ! empty( $scMeta['title_tag'][0] ) && in_array( $scMeta['title_tag'][0], array_keys( $rtTPG->getTitleTags() ) ) ) ? esc_attr( $scMeta['title_tag'][0] ) : 'h2';
223
- $postQuery = new WP_Query( $args );
224
- // Start layout
225
- $html .= "<div class='container-fluid rt-tpg-container {$parentClass}' id='{$layoutID}'>";
226
- $extClass = null;
227
- if ( $isIsotope ) {
228
- $extClass = ' tpg-isotope';
229
- }
230
- $html .= "<div class='row {$layout}{$extClass}'>";
231
- if ( $postQuery->have_posts() ) {
232
- $html .= $this->layoutStyle( $layoutID, $scMeta );
233
-
234
- if ( $isIsotope ) {
235
- $isotope_filter = isset( $scMeta['isotope_filter'][0] ) ? $scMeta['isotope_filter'][0] : null;
236
- $selectedTerms = ( isset( $scMeta[ 'term_' . $isotope_filter ] ) ? $scMeta[ 'term_' . $isotope_filter ] : array() );
237
- $terms = get_terms( $isotope_filter, array(
238
- 'orderby' => 'name',
239
- 'order' => 'ASC',
240
- 'hide_empty' => false,
241
- 'include' => $selectedTerms
242
- ) );
243
-
244
- $html .= '<div id="iso-button-' . $rand . '" class="rt-tpg-isotope-buttons button-group filter-button-group option-set">
245
- <button data-filter="*" class="selected">' . __( 'Show all',
246
- 'the-post-grid' ) . '</button>';
247
- if ( ! empty( $terms ) && ! is_wp_error( $terms ) ) {
248
- foreach ( $terms as $term ) {
249
- $html .= "<button data-filter='.iso_{$term->term_id}'>" . $term->name . "</button>";
250
- }
251
- }
252
- $html .= '</div>';
253
-
254
- $html .= '<div class="rt-tpg-isotope" id="iso-tpg-' . $rand . '">';
255
- }
256
-
257
-
258
- while ( $postQuery->have_posts() ) : $postQuery->the_post();
259
- $pID = get_the_ID();
260
- $arg['pID'] = $pID;
261
- $arg['title'] = get_the_title();
262
- $arg['pLink'] = get_permalink();
263
- $arg['author'] = '<a href="' . get_author_posts_url( get_the_author_meta( 'ID' ) ) . '">' . get_the_author() . '</a>';
264
- $cc = wp_count_comments( $pID );
265
- $arg['date'] = get_the_date();
266
- $arg['excerpt'] = $rtTPG->get_the_excerpt($pID, $arg);
267
- $arg['categories'] = get_the_term_list( $pID, 'category', null, ', ' );
268
- $arg['tags'] = get_the_term_list( $pID, 'post_tag', null, ', ' );
269
- if ( $isIsotope ) {
270
- $isotope_filter = isset( $scMeta['isotope_filter'][0] ) ? $scMeta['isotope_filter'][0] : null;
271
- $termAs = wp_get_post_terms( $pID, $isotope_filter, array( "fields" => "all" ) );
272
- $isoFilter = null;
273
- if ( ! empty( $termAs ) ) {
274
- foreach ( $termAs as $term ) {
275
- $isoFilter .= " iso_" . $term->term_id;
276
- }
277
- }
278
- $arg['isoFilter'] = $isoFilter;
279
- }
280
- $deptClass = null;
281
- if ( ! empty( $deptAs ) ) {
282
- foreach ( $deptAs as $dept ) {
283
- $deptClass .= " " . $dept->slug;
284
- }
285
- }
286
- if ( comments_open() ) {
287
- $arg['comment'] = "<a href='" . get_comments_link( $pID ) . "'>{$cc->total_comments} </a>";
288
- } else {
289
- $arg['comment'] = "{$cc->total_comments}";
290
- }
291
- $imgSrc = null;
292
-
293
- $arg['imgSrc'] = ! $fImg ? $rtTPG->getFeatureImageSrc( $pID, $fImgSize, $mediaSource ) : null;
294
-
295
- $html .= $rtTPG->render( 'layouts/' . $layout, $arg, true );
296
-
297
- endwhile;
298
-
299
- if ( $isIsotope ) {
300
- $html .= '</div>'; // End isotope item holder
301
- }
302
-
303
- } else {
304
- $html .= "<p>" . __( 'No post found', 'the-post-grid' ) . "</p>";
305
- }
306
- $html .= "</div>"; // End row
307
- if ( $pagination && ! $isIsotope ) {
308
- $found = 0;
309
- if ( $postQuery->found_posts > $limit ) {
310
- $found = $limit;
311
- } else {
312
- $found = $postQuery->found_posts;
313
- }
314
- $max_num_pages = ceil( $found / $posts_per_page );
315
- $html .= $rtTPG->rt_pagination( $max_num_pages, $args['posts_per_page'] );
316
- }
317
- $html .= "</div>"; // container rt-tpg
318
-
319
- wp_reset_postdata();
320
-
321
- $scriptGenerator = array();
322
- $scriptGenerator['layout'] = $layoutID;
323
- $scriptGenerator['rand'] = $rand;
324
- $scriptGenerator['scMeta'] = $scMeta;
325
- $scriptGenerator['isIsotope'] = $isIsotope;
326
- $this->scA[] = $scriptGenerator;
327
- add_action( 'wp_footer', array( $this, 'register_sc_scripts' ) );
328
- } else {
329
- $html .= "<p>" . __( "No shortCode found", 'the-post-grid' ) . "</p>";
330
- }
331
-
332
- return $html;
333
- }
334
-
335
- private function layoutStyle( $layout, $scMeta ) {
336
- $css = null;
337
- $css .= "<style type='text/css' media='all'>";
338
- // Variable
339
- $primaryColor = ( ! empty( $scMeta['primary_color'][0] ) ? $scMeta['primary_color'][0] : null );
340
- if ( $primaryColor ) {
341
- $css .= "#{$layout} .rt-detail i,#{$layout} .rt-detail .post-meta-user a,#{$layout} .rt-detail .post-meta-category a{";
342
- $css .= "color:" . $primaryColor . ";";
343
- $css .= "}";
344
- $css .= "body .rt-tpg-container .rt-tpg-isotope-buttons .selected{";
345
- $css .= "background-color:" . $primaryColor . ";";
346
- $css .= "}";
347
- }
348
- $button_bg_color = ( ! empty( $scMeta['button_bg_color'][0] ) ? $scMeta['button_bg_color'][0] : null );
349
- if ( $button_bg_color ) {
350
- $css .= "#{$layout} .pagination li a,#{$layout} .rt-tpg-isotope-buttons button,#{$layout} .rt-detail .read-more a{";
351
- $css .= "background-color:" . $button_bg_color . ";";
352
- $css .= "}";
353
- }
354
- $button_hover_bg_color = ( ! empty( $scMeta['button_hover_bg_color'][0] ) ? $scMeta['button_hover_bg_color'][0] : null );
355
- if ( $button_hover_bg_color ) {
356
- $css .= "#{$layout} .pagination li a:hover,#{$layout} .rt-tpg-isotope-buttons button:hover,#{$layout} .rt-detail .read-more a:hover{";
357
- $css .= "background-color:" . $button_hover_bg_color . ";";
358
- $css .= "}";
359
- }
360
- $button_active_bg_color = ( ! empty( $scMeta['button_active_bg_color'][0] ) ? $scMeta['button_active_bg_color'][0] : null );
361
- if ( $button_active_bg_color ) {
362
- $css .= "#{$layout} .pagination li.active span, #{$layout} .rt-tpg-isotope-buttons button.selected{";
363
- $css .= "background-color:" . $button_active_bg_color . ";";
364
- $css .= "}";
365
- }
366
- $button_text_color = ( ! empty( $scMeta['button_text_color'][0] ) ? $scMeta['button_text_color'][0] : null );
367
- if ( $button_text_color ) {
368
- $css .= "#{$layout} .pagination li a,#{$layout} .rt-tpg-isotope-buttons button,#{$layout} .rt-detail .read-more a{";
369
- $css .= "color:" . $button_text_color . ";";
370
- $css .= "}";
371
- }
372
- $title_color = ( ! empty( $scMeta['title_color'][0] ) ? $scMeta['title_color'][0] : null );
373
- if ( $title_color ) {
374
- $css .= "#{$layout} .rt-detail h2.entry-title a{";
375
- $css .= "color:" . $title_color . ";";
376
- $css .= "}";
377
- }
378
-
379
- $css .= "</style>";
380
-
381
- return $css;
382
- }
383
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
384
  endif;
1
  <?php
2
 
3
+ if (!class_exists('rtTPGShortCode')):
4
+
5
+ class rtTPGShortCode
6
+ {
7
+
8
+ private $scA = array();
9
+
10
+ function __construct() {
11
+ add_shortcode('the-post-grid', array($this, 'the_post_grid_short_code'));
12
+ add_action('wp_ajax_tpgPreviewAjaxCall', array($this, 'the_post_grid_short_code'));
13
+ }
14
+
15
+ function register_sc_scripts() {
16
+ $iso = false;
17
+ foreach ($this->scA as $sc) {
18
+ if (isset($sc) && is_array($sc)) {
19
+ if ($sc['isIsotope']) {
20
+ $iso = true;
21
+ }
22
+ }
23
+ }
24
+ if (count($this->scA)) {
25
+ if ($iso) {
26
+ wp_enqueue_script('rt-isotope-js');
27
+ }
28
+ wp_enqueue_style('rt-fontawsome');
29
+ wp_enqueue_script('rt-actual-height-js');
30
+ wp_enqueue_script('rt-tpg');
31
+ $nonce = wp_create_nonce(rtTPG()->nonceText());
32
+ wp_localize_script('rt-tpg', 'rttpg',
33
+ array(
34
+ 'nonceID' => rtTPG()->nonceId(),
35
+ 'nonce' => $nonce,
36
+ 'ajaxurl' => admin_url('admin-ajax.php')
37
+ ));
38
+ }
39
+ }
40
+
41
+ function the_post_grid_short_code($atts = array(), $content = null) {
42
+ $error = true;
43
+ $html = $msg = null;
44
+ $preview = isset($_REQUEST['sc_id']) ? absint($_REQUEST['sc_id']) : 0;
45
+ $arg = array();
46
+ $atts = shortcode_atts(array(
47
+ 'id' => null
48
+ ), $atts, 'the-post-grid');
49
+ $scID = $atts['id'];
50
+ if ((!$preview && $scID && !is_null(get_post($scID))) || ($preview && rtTPG()->verifyNonce())) {
51
+ $rand = mt_rand();
52
+ $layoutID = "rt-tpg-container-" . $rand;
53
+ $pagination = false;
54
+
55
+ if ($preview) {
56
+ $error = false;
57
+ $scMeta = $_REQUEST;
58
+ $layout = isset($scMeta['layout']) ? $scMeta['layout'] : 'layout1';
59
+ $col = isset($scMeta['column']) ? intval($scMeta['column']) : 4;
60
+
61
+ $fImg = isset($scMeta['featured_image']) ? true : false;
62
+ $fImgSize = isset($scMeta['featured_image_size']) ? $scMeta['featured_image_size'] : "medium";
63
+ $mediaSource = isset($scMeta['media_source']) ? $scMeta['media_source'] : "feature_image";
64
+ $arg['excerpt_type'] = isset($scMeta['tgp_excerpt_type']) ? $scMeta['tgp_excerpt_type'] : 'character';
65
+ $arg['excerpt_limit'] = isset($scMeta['excerpt_limit']) ? absint($scMeta['excerpt_limit']) : 0;
66
+ $arg['excerpt_more_text'] = isset($scMeta['tgp_excerpt_more_text']) ? $scMeta['tgp_excerpt_more_text'] : null;
67
+ $arg['title_limit_type'] = isset($scMeta['tpg_title_limit_type']) ? $scMeta['tpg_title_limit_type'] : 'character';
68
+ $arg['title_limit'] = isset($scMeta['tpg_title_limit']) ? absint($scMeta['tpg_title_limit']) : 0;
69
+ $arg['read_more_text'] = isset($scMeta['tgp_read_more_text']) && !empty($scMeta['tgp_read_more_text']) ? $scMeta['tgp_read_more_text'] : __('Read More',
70
+ 'the-post-grid');
71
+ $arg['show_all_text'] = isset($scMeta['tpg_show_all_text']) && !empty($scMeta['tpg_show_all_text']) ? $scMeta['tpg_show_all_text'] : __('Show all',
72
+ 'the-post-grid-pro');
73
+ $postType = isset($scMeta['tpg_post_type']) ? $scMeta['tpg_post_type'] : null;
74
+ $post__in = isset($scMeta['post__in']) ? $scMeta['post__in'] : null;
75
+ $post__not_in = isset($scMeta['post__not_in']) ? $scMeta['post__not_in'] : null;
76
+ $limit = !isset($scMeta['limit']) ? ($scMeta['limit'] == -1 ? 10000000 : (int)$scMeta['limit']) : 10000000;
77
+ $pagination = isset($scMeta['pagination']) ? $scMeta['pagination'] : false;
78
+ $posts_per_page = isset($scMeta['posts_per_page']) ? intval($scMeta['posts_per_page']) : $limit;
79
+ $order_by = isset($scMeta['order_by']) ? $scMeta['order_by'] : null;
80
+ $order = isset($scMeta['order']) ? $scMeta['order'] : null;
81
+ $s = isset($scMeta['s']) ? $scMeta['s'] : null;
82
+ $isotope_filter = isset($scMeta['isotope_filter']) ? $scMeta['isotope_filter'] : null;
83
+
84
+ } else {
85
+ $scMeta = get_post_meta($scID);
86
+ $scMeta['sc_id'] = $scID;
87
+ $layout = isset($scMeta['layout'][0]) ? $scMeta['layout'][0] : 'layout1';
88
+ $col = isset($scMeta['column'][0]) ? intval($scMeta['column'][0]) : 4;
89
+
90
+ $fImg = isset($scMeta['featured_image'][0]) ? true : false;
91
+ $fImgSize = isset($scMeta['featured_image_size'][0]) ? $scMeta['featured_image_size'][0] : "medium";
92
+ $mediaSource = isset($scMeta['media_source'][0]) ? $scMeta['media_source'][0] : "feature_image";
93
+ $arg['excerpt_type'] = isset($scMeta['tgp_excerpt_type'][0]) ? $scMeta['tgp_excerpt_type'][0] : 'character';
94
+ $arg['excerpt_limit'] = isset($scMeta['excerpt_limit'][0]) ? absint($scMeta['excerpt_limit'][0]) : 0;
95
+ $arg['excerpt_more_text'] = isset($scMeta['tgp_excerpt_more_text'][0]) ? $scMeta['tgp_excerpt_more_text'][0] : null;
96
+ $arg['title_limit_type'] = isset($scMeta['tpg_title_limit_type'][0]) ? $scMeta['tpg_title_limit_type'][0] : 'character';
97
+ $arg['title_limit'] = isset($scMeta['tpg_title_limit'][0]) ? absint($scMeta['tpg_title_limit'][0]) : 0;
98
+ $arg['read_more_text'] = isset($scMeta['tgp_read_more_text'][0]) && !empty($scMeta['tgp_read_more_text'][0]) ? $scMeta['tgp_read_more_text'][0] : __('Read More',
99
+ 'the-post-grid');
100
+ $arg['show_all_text'] = (!empty($scMeta['tpg_show_all_text'][0]) ? $scMeta['tpg_show_all_text'][0] : __('Show all',
101
+ 'the-post-grid-pro'));
102
+
103
+ $postType = isset($scMeta['tpg_post_type'][0]) ? $scMeta['tpg_post_type'][0] : null;
104
+ $post__in = isset($scMeta['post__in'][0]) ? $scMeta['post__in'][0] : null;
105
+ $post__not_in = isset($scMeta['post__not_in'][0]) ? $scMeta['post__not_in'][0] : null;
106
+ $limit = !isset($scMeta['limit'][0]) ? ($scMeta['limit'][0] == -1 ? 10000000 : (int)$scMeta['limit'][0]) : 10000000;
107
+ $pagination = isset($scMeta['pagination'][0]) ? $scMeta['pagination'][0] : false;
108
+ $posts_per_page = isset($scMeta['posts_per_page'][0]) ? intval($scMeta['posts_per_page'][0]) : $limit;
109
+ $order_by = isset($scMeta['order_by'][0]) ? $scMeta['order_by'][0] : null;
110
+ $order = isset($scMeta['order'][0]) ? $scMeta['order'][0] : null;
111
+ $s = isset($scMeta['s'][0]) ? $scMeta['s'][0] : null;
112
+ $isotope_filter = isset($scMeta['isotope_filter'][0]) ? $scMeta['isotope_filter'][0] : null;
113
+
114
+ }
115
+ if (!in_array($layout, array_keys(rtTPG()->rtTPGLayouts()))) {
116
+ $layout = 'layout1';
117
+ }
118
+ if (!in_array($col, array_keys(rtTPG()->rtTPGColumns()))) {
119
+ $col = 4;
120
+ }
121
+
122
+ $isIsotope = preg_match('/isotope/', $layout);
123
+
124
+ /* Argument create */
125
+ $args = array();
126
+ $itemIdsArgs = array();
127
+ if ($postType) {
128
+ $args['post_type'] = $itemIdsArgs['post_type'] = $postType;
129
+ }
130
+
131
+ // Common filter
132
+ /* post__in */
133
+ if ($post__in) {
134
+ $post__in = explode(',', $post__in);
135
+ $args['post__in'] = $itemIdsArgs['post__in'] = $post__in;
136
+ }
137
+ /* post__not_in */
138
+ if ($post__not_in) {
139
+ $post__not_in = explode(',', $post__not_in);
140
+ $args['post__not_in'] = $itemIdsArgs['post__not_in'] = $post__not_in;
141
+ }
142
+
143
+ /* LIMIT */
144
+ $args['posts_per_page'] = $itemIdsArgs['posts_per_page'] = $limit;
145
+ if (!$isIsotope && $pagination) {
146
+ if ($posts_per_page > $limit) {
147
+ $posts_per_page = $limit;
148
+ }
149
+ // Set 'posts_per_page' parameter
150
+ $args['posts_per_page'] = $posts_per_page;
151
+ if (get_query_var('paged')) {
152
+ $paged = get_query_var('paged');
153
+ } elseif (get_query_var('page')) {
154
+ $paged = get_query_var('page');
155
+ } else {
156
+ $paged = 1;
157
+ }
158
+ $offset = $posts_per_page * ((int)$paged - 1);
159
+ $args['paged'] = $paged;
160
+
161
+ // Update posts_per_page
162
+ if (intval($args['posts_per_page']) > $limit - $offset) {
163
+ $args['posts_per_page'] = $limit - $offset;
164
+ }
165
+
166
+
167
+ }
168
+
169
+ // Advance Filter
170
+ $adv_filter = isset($scMeta['post_filter']) ? $scMeta['post_filter'] : array();
171
+
172
+ // Taxonomy
173
+ $taxQ = array();
174
+ if (in_array('tpg_taxonomy', $adv_filter) && isset($scMeta['tpg_taxonomy'])) {
175
+
176
+ if (is_array($scMeta['tpg_taxonomy']) && !empty($scMeta['tpg_taxonomy'])) {
177
+ foreach ($scMeta['tpg_taxonomy'] as $taxonomy) {
178
+ $terms = (isset($scMeta['term_' . $taxonomy]) ? $scMeta['term_' . $taxonomy] : array());
179
+ if (is_array($terms) && !empty($terms)) {
180
+ $operator = isset($scMeta['term_operator_' . $taxonomy][0]) ? $scMeta['term_operator_' . $taxonomy][0] : "IN";
181
+ if ($preview) {
182
+ $operator = isset($scMeta['term_operator_' . $taxonomy]) ? $scMeta['term_operator_' . $taxonomy] : "IN";
183
+ }
184
+ $taxQ[] = array(
185
+ 'taxonomy' => $taxonomy,
186
+ 'field' => 'term_id',
187
+ 'terms' => $terms,
188
+ 'operator' => $operator,
189
+ );
190
+ }
191
+ }
192
+ }
193
+ if (count($taxQ) >= 2) {
194
+ $relation = isset($scMeta['taxonomy_relation'][0]) ? $scMeta['taxonomy_relation'][0] : "AND";
195
+ if ($preview) {
196
+ $relation = isset($scMeta['taxonomy_relation']) ? $scMeta['taxonomy_relation'] : "AND";
197
+ }
198
+ $taxQ['relation'] = $relation;
199
+ }
200
+ }
201
+
202
+ if (!empty($taxQ)) {
203
+ $args['tax_query'] = $itemIdsArgs['tax_query'] = $taxQ;
204
+ }
205
+
206
+ // Order
207
+ if (in_array('order', $adv_filter)) {
208
+ if ($order) {
209
+ $args['order'] = $itemIdsArgs['order'] = $order;
210
+ }
211
+ if ($order_by) {
212
+ $args['orderby'] = $itemIdsArgs['orderby'] = $order_by;
213
+ }
214
+ }
215
+ // Status
216
+ if (in_array('tpg_post_status', $adv_filter)) {
217
+ $post_status = (isset($scMeta['tpg_post_status']) ? $scMeta['tpg_post_status'] : array());
218
+ if (!empty($post_status)) {
219
+ $args['post_status'] = $itemIdsArgs['post_status'] = $post_status;
220
+ } else {
221
+ $args['post_status'] = $itemIdsArgs['post_status'] = 'publish';
222
+ }
223
+ }
224
+ // Author
225
+ $author = (isset($scMeta['author']) ? $scMeta['author'] : array());
226
+ if (in_array('author', $adv_filter) && !empty($author)) {
227
+ $args['author__in'] = $itemIdsArgs['author__in'] = $author;
228
+ }
229
+ // Search
230
+ if (in_array('s', $adv_filter) && $s) {
231
+ $args['s'] = $itemIdsArgs['s'] = $s;
232
+ }
233
+
234
+ // Validation
235
+
236
+ if (($layout == 'layout2') || ($layout == 'layout3')) {
237
+ $iCol = isset($scMeta['tgp_layout2_image_column'][0]) ? absint($scMeta['tgp_layout2_image_column'][0]) : 4;
238
+ if ($preview) {
239
+ $iCol = isset($scMeta['tgp_layout2_image_column']) ? absint($scMeta['tgp_layout2_image_column']) : 4;
240
+ }
241
+ $iCol = $iCol > 12 ? 4 : $iCol;
242
+ $cCol = 12 - $iCol;
243
+ $arg['image_area'] = "rt-col-sm-{$iCol} rt-col-xs-12 ";
244
+ $arg['content_area'] = "rt-col-sm-{$cCol} rt-col-xs-12 ";
245
+ }
246
+ $col = $col == 5 ? "24" : round(12 / $col);
247
+ if (($layout == 'layout2') || ($layout == 'layout3')) {
248
+ $arg['grid'] = "rt-col-lg-{$col} rt-col-md-{$col} rt-col-sm-12 rt-col-xs-12";
249
+ } else {
250
+ $arg['grid'] = "rt-col-lg-{$col} rt-col-md-{$col} rt-col-sm-6 rt-col-xs-12";
251
+ }
252
+
253
+
254
+ $arg['class'] = 'rt-equal-height';
255
+ if ($isIsotope) {
256
+ $arg['class'] .= ' isotope-item';
257
+ }
258
+
259
+ $arg['overlay'] = empty($scMeta['tpg_overlay'][0]) ? false : true;
260
+ $parentClass = (!empty($scMeta['parent_class'][0]) ? trim($scMeta['parent_class'][0]) : null);
261
+ $arg['items'] = isset($scMeta['item_fields']) ? ($scMeta['item_fields'] ? $scMeta['item_fields'] : array()) : array();
262
+ $arg['title_tag'] = (!empty($scMeta['title_tag'][0]) && in_array($scMeta['title_tag'][0], array_keys(rtTPG()->getTitleTags()))) ? esc_attr($scMeta['title_tag'][0]) : 'h2';
263
+ $postQuery = new WP_Query(apply_filters('tpg_sc_query_args', $args, $scMeta));
264
+ // Start layout
265
+ $html .= "<div class='container-fluid rt-tpg-container rt-tpg-container-{$scMeta['sc_id']} {$parentClass}' data-sc-id='{$scMeta['sc_id']}' id='{$layoutID}'>";
266
+ $extClass = null;
267
+ if ($isIsotope) {
268
+ $extClass = ' tpg-isotope';
269
+ }
270
+ $html .= "<div class='row rt-content-loader {$layout}{$extClass}'>";
271
+ if ($postQuery->have_posts()) {
272
+ $html .= $this->layoutStyle($layoutID, $scMeta, $preview);
273
+
274
+ if ($isIsotope) {
275
+ $selectedTerms = (isset($scMeta['term_' . $isotope_filter]) ? $scMeta['term_' . $isotope_filter] : array());
276
+ $terms = get_terms($isotope_filter, array(
277
+ 'orderby' => 'name',
278
+ 'order' => 'ASC',
279
+ 'hide_empty' => false,
280
+ 'include' => $selectedTerms
281
+ ));
282
+
283
+ $html .= '<div id="iso-button-' . $rand . '" class="iso-button-' . $scMeta['sc_id'] . ' rt-tpg-isotope-buttons filter-button-group option-set">
284
+ <button data-filter="*" class="selected">' . $arg['show_all_text'] . '</button>';
285
+ if (!empty($terms) && !is_wp_error($terms)) {
286
+ foreach ($terms as $term) {
287
+ $html .= "<button data-filter='.iso_{$term->term_id}'>" . $term->name . "</button>";
288
+ }
289
+ }
290
+ $html .= '</div>';
291
+
292
+ $html .= '<div class="rt-tpg-isotope iso-tpg-' . $scMeta['sc_id'] . '" id="iso-tpg-' . $rand . '">';
293
+ }
294
+
295
+
296
+ while ($postQuery->have_posts()) {
297
+ $postQuery->the_post();
298
+ $pID = get_the_ID();
299
+ $arg['pID'] = $pID;
300
+ $arg['title'] = rtTPG()->get_the_title($pID, $arg);
301
+ $arg['pLink'] = get_permalink();
302
+ $arg['author'] = '<a href="' . get_author_posts_url(get_the_author_meta('ID')) . '">' . get_the_author() . '</a>';
303
+ $cc = wp_count_comments($pID);
304
+ $arg['date'] = get_the_date();
305
+ $arg['excerpt'] = rtTPG()->get_the_excerpt($pID, $arg);
306
+ $arg['categories'] = get_the_term_list($pID, 'category', null, ', ');
307
+ $arg['tags'] = get_the_term_list($pID, 'post_tag', null, ', ');
308
+ if ($isIsotope) {
309
+ $termAs = wp_get_post_terms($pID, $isotope_filter, array("fields" => "all"));
310
+ $isoFilter = null;
311
+ if (!empty($termAs)) {
312
+ foreach ($termAs as $term) {
313
+ $isoFilter .= " iso_" . $term->term_id;
314
+ }
315
+ }
316
+ $arg['isoFilter'] = $isoFilter;
317
+ }
318
+ $deptClass = null;
319
+ if (!empty($deptAs)) {
320
+ foreach ($deptAs as $dept) {
321
+ $deptClass .= " " . $dept->slug;
322
+ }
323
+ }
324
+ if (comments_open()) {
325
+ $arg['comment'] = "<a href='" . get_comments_link($pID) . "'>{$cc->total_comments} </a>";
326
+ } else {
327
+ $arg['comment'] = "{$cc->total_comments}";
328
+ }
329
+ $imgSrc = null;
330
+
331
+ $arg['imgSrc'] = !$fImg ? rtTPG()->getFeatureImageSrc($pID, $fImgSize, $mediaSource) : null;
332
+
333
+ $html .= rtTPG()->render('layouts/' . $layout, $arg, true);
334
+ }
335
+
336
+ if ($isIsotope) {
337
+ $html .= '</div>'; // End isotope item holder
338
+ }
339
+
340
+ } else {
341
+ $html .= sprintf('<p>%s</p>',
342
+ apply_filters('tpg_not_found_text', __('No post found', 'the-post-grid'), $args, $scMeta)
343
+ );
344
+ }
345
+ $html .= "</div>"; // End row
346
+ if ($pagination && !$isIsotope) {
347
+ $found = 0;
348
+ if ($postQuery->found_posts > $limit) {
349
+ $found = $limit;
350
+ } else {
351
+ $found = $postQuery->found_posts;
352
+ }
353
+ $max_num_pages = ceil($found / $posts_per_page);
354
+ $html .= rtTPG()->rt_pagination($max_num_pages, $args['posts_per_page']);
355
+ }
356
+ $html .= "</div>"; // container rt-tpg
357
+
358
+ wp_reset_postdata();
359
+ if (!$preview) {
360
+ $scriptGenerator = array();
361
+ $scriptGenerator['layout'] = $layoutID;
362
+ $scriptGenerator['rand'] = $rand;
363
+ $scriptGenerator['scMeta'] = $scMeta;
364
+ $scriptGenerator['isIsotope'] = $isIsotope;
365
+ $this->scA[] = $scriptGenerator;
366
+ add_action('wp_footer', array($this, 'register_sc_scripts'));
367
+ }
368
+ } else {
369
+ if ($preview) {
370
+ $msg = __('Session Error !!', 'the-post-grid');
371
+ } else {
372
+ $html .= "<p>" . __("No shortCode found", 'the-post-grid') . "</p>";
373
+ }
374
+ }
375
+ if ($preview) {
376
+ wp_send_json(array(
377
+ 'error' => $error,
378
+ 'msg' => $msg,
379
+ 'data' => $html
380
+ ));
381
+ die();
382
+ }
383
+ return $html;
384
+ }
385
+
386
+ function layoutStyle($layout, $scMeta, $preview = false) {
387
+ if ($preview) {
388
+ $primaryColor = (!empty($scMeta['primary_color']) ? $scMeta['primary_color'] : null);
389
+ $button_bg_color = (!empty($scMeta['button_bg_color']) ? $scMeta['button_bg_color'] : null);
390
+ $button_hover_bg_color = (!empty($scMeta['button_hover_bg_color']) ? $scMeta['button_hover_bg_color'] : null);
391
+ $button_active_bg_color = (!empty($scMeta['button_active_bg_color']) ? $scMeta['button_active_bg_color'] : null);
392
+ $button_text_color = (!empty($scMeta['button_text_color']) ? $scMeta['button_text_color'] : null);
393
+ $title_color = isset($scMeta['title_color']) && !empty($scMeta['title_color']) ? $scMeta['title_color'] : null;
394
+ $title_hover_color = isset($scMeta['title_hover_color']) && !empty($scMeta['title_hover_color']) ? $scMeta['title_hover_color'] : null;
395
+ $read_more_button_border_radius = isset($scMeta['tpg_read_more_button_border_radius']) ? $scMeta['tpg_read_more_button_border_radius'] : '';
396
+
397
+ } else {
398
+
399
+ $primaryColor = (!empty($scMeta['primary_color'][0]) ? $scMeta['primary_color'][0] : null);
400
+ $button_bg_color = (!empty($scMeta['button_bg_color'][0]) ? $scMeta['button_bg_color'][0] : null);
401
+ $button_hover_bg_color = (!empty($scMeta['button_hover_bg_color'][0]) ? $scMeta['button_hover_bg_color'][0] : null);
402
+ $button_active_bg_color = (!empty($scMeta['button_active_bg_color'][0]) ? $scMeta['button_active_bg_color'][0] : null);
403
+ $button_text_color = (!empty($scMeta['button_text_color'][0]) ? $scMeta['button_text_color'][0] : null);
404
+ $title_color = isset($scMeta['title_color'][0]) && !empty($scMeta['title_color'][0]) ? $scMeta['title_color'][0] : null;
405
+ $title_hover_color = isset($scMeta['title_hover_color'][0]) && !empty($scMeta['title_hover_color'][0]) ? $scMeta['title_hover_color'][0] : null;
406
+ $read_more_button_border_radius = isset($scMeta['tpg_read_more_button_border_radius'][0]) ? $scMeta['tpg_read_more_button_border_radius'][0] : '';
407
+
408
+ }
409
+ $css = null;
410
+ $css .= "<style type='text/css' media='all'>";
411
+ // Variable
412
+ if ($primaryColor) {
413
+ $css .= "#{$layout} .rt-detail i,
414
+ #{$layout} .rt-detail .post-meta-user a,
415
+ #{$layout} .rt-detail .post-meta-category a{";
416
+ $css .= "color:" . $primaryColor . ";";
417
+ $css .= "}";
418
+ $css .= "body .rt-tpg-container .rt-tpg-isotope-buttons .selected{";
419
+ $css .= "background-color:" . $primaryColor . ";";
420
+ $css .= "}";
421
+ }
422
+ if ($button_bg_color) {
423
+ $css .= "#{$layout} .pagination li a,
424
+ #{$layout} .rt-tpg-isotope-buttons button,
425
+ #{$layout} .rt-detail .read-more a{";
426
+ $css .= "background-color:" . $button_bg_color . ";";
427
+ $css .= "}";
428
+ }
429
+ if ($button_hover_bg_color) {
430
+ $css .= "#{$layout} .pagination li a:hover,
431
+ #{$layout} .rt-tpg-isotope-buttons button:hover,
432
+ #{$layout} .rt-detail .read-more a:hover{";
433
+ $css .= "background-color:" . $button_hover_bg_color . ";";
434
+ $css .= "}";
435
+ }
436
+ if ($button_active_bg_color) {
437
+ $css .= "#{$layout} .pagination li.active span,
438
+ #{$layout} .rt-tpg-isotope-buttons button.selected{";
439
+ $css .= "background-color:" . $button_active_bg_color . ";";
440
+ $css .= "}";
441
+ }
442
+ if ($button_text_color) {
443
+ $css .= "#{$layout} .pagination li a,
444
+ #{$layout} .rt-tpg-isotope-buttons button,
445
+ #{$layout} .rt-detail .read-more a{";
446
+ $css .= "color:" . $button_text_color . ";";
447
+ $css .= "}";
448
+ }
449
+ if ($title_color) {
450
+ $css .= "#{$layout} .rt-detail h2.entry-title a,
451
+ #{$layout} .rt-detail h3.entry-title a,
452
+ #{$layout} .rt-detail h4.entry-title a{";
453
+ $css .= "color:" . $title_color . ";";
454
+ $css .= "}";
455
+ }
456
+ if ($title_hover_color) {
457
+ $css .= "#{$layout} .rt-detail h2.entry-title a:hover,
458
+ #{$layout} .rt-detail h3.entry-title a:hover,
459
+ #{$layout} .rt-detail h4.entry-title a:hover{";
460
+ $css .= "color:" . $title_hover_color . ";";
461
+ $css .= "}";
462
+ }
463
+
464
+ // Read more button Position
465
+ if (isset($read_more_button_border_radius) || trim($read_more_button_border_radius) !== '') {
466
+ $css .= "#{$layout} .read-more a{";
467
+ $css .= "border-radius:" . $read_more_button_border_radius . "px;";
468
+ $css .= "}";
469
+ }
470
+
471
+ $css .= "</style>";
472
+
473
+ return $css;
474
+ }
475
+ }
476
  endif;
lib/init.php CHANGED
@@ -1,139 +1,155 @@
1
  <?php
2
 
3
- if ( ! class_exists( 'rtTPG' ) ) {
4
-
5
- class rtTPG {
6
- public $options;
7
- public $post_type;
8
- public $assetsUrl;
9
- public $libPath;
10
-
11
- function __construct() {
12
-
13
- $this->options = array(
14
- 'settings' => 'rt_the_post_grid_settings',
15
- 'version' => RT_THE_POST_GRID_VERSION,
16
- 'installed_version' => 'rt_the_post_grid_current_version'
17
- );
18
- $this->defaultSettings = array(
19
- 'title_tag' => 'h2',
20
- 'custom_css' => null
21
- );
22
-
23
- $this->post_type = "rttpg";
24
- $this->libPath = dirname( __FILE__ );
25
- $this->modelsPath = $this->libPath . '/models/';
26
- $this->classesPath = $this->libPath . '/classes/';
27
- $this->widgetsPath = $this->libPath . '/widgets/';
28
- $this->viewsPath = $this->libPath . '/views/';
29
- $this->assetsUrl = RT_THE_POST_GRID_PLUGIN_URL . '/assets/';
30
-
31
- $this->rtLoadModel( $this->modelsPath );
32
- $this->rtLoadClass( $this->classesPath );
33
-
34
- }
35
-
36
- function rtLoadModel( $dir ) {
37
- if ( ! file_exists( $dir ) ) {
38
- return;
39
- }
40
- foreach ( scandir( $dir ) as $item ) {
41
- if ( preg_match( "/.php$/i", $item ) ) {
42
- require_once( $dir . $item );
43
- }
44
- }
45
- }
46
-
47
- function rtLoadClass( $dir ) {
48
- if ( ! file_exists( $dir ) ) {
49
- return;
50
- }
51
- $classes = array();
52
- foreach ( scandir( $dir ) as $item ) {
53
- if ( preg_match( "/.php$/i", $item ) ) {
54
- require_once( $dir . $item );
55
- $className = str_replace( ".php", "", $item );
56
- $classes[] = new $className;
57
- }
58
- }
59
- if ( $classes ) {
60
- foreach ( $classes as $class ) {
61
- $this->objects[] = $class;
62
- }
63
- }
64
- }
65
-
66
- function loadWidget( $dir ) {
67
- if ( ! file_exists( $dir ) ) {
68
- return;
69
- }
70
- foreach ( scandir( $dir ) as $item ) {
71
- if ( preg_match( "/.php$/i", $item ) ) {
72
- require_once( $dir . $item );
73
- $class = str_replace( ".php", "", $item );
74
- if ( method_exists( $class, 'register_widget' ) ) {
75
- $caller = new $class;
76
- $caller->register_widget();
77
- } else {
78
- register_widget( $class );
79
- }
80
- }
81
- }
82
- }
83
-
84
-
85
- function render( $viewName, $args = array(), $return = false ) {
86
- global $rtTPG;
87
- $path = str_replace( ".", "/", $viewName );
88
- $viewPath = $rtTPG->viewsPath . $path . '.php';
89
- if ( ! file_exists( $viewPath ) ) {
90
- return;
91
- }
92
- if ( $args ) {
93
- extract( $args );
94
- }
95
- if ( $return ) {
96
- ob_start();
97
- include $viewPath;
98
-
99
- return ob_get_clean();
100
- }
101
- include $viewPath;
102
- }
103
-
104
- /**
105
- * Dynamicaly call any method from models class
106
- * by pluginFramework instance
107
- */
108
- function __call( $name, $args ) {
109
- if ( ! is_array( $this->objects ) ) {
110
- return;
111
- }
112
- foreach ( $this->objects as $object ) {
113
- if ( method_exists( $object, $name ) ) {
114
- $count = count( $args );
115
- if ( $count == 0 ) {
116
- return $object->$name();
117
- } elseif ( $count == 1 ) {
118
- return $object->$name( $args[0] );
119
- } elseif ( $count == 2 ) {
120
- return $object->$name( $args[0], $args[1] );
121
- } elseif ( $count == 3 ) {
122
- return $object->$name( $args[0], $args[1], $args[2] );
123
- } elseif ( $count == 4 ) {
124
- return $object->$name( $args[0], $args[1], $args[2], $args[3] );
125
- } elseif ( $count == 5 ) {
126
- return $object->$name( $args[0], $args[1], $args[2], $args[3], $args[4] );
127
- } elseif ( $count == 6 ) {
128
- return $object->$name( $args[0], $args[1], $args[2], $args[3], $args[4], $args[5] );
129
- }
130
- }
131
- }
132
- }
133
- }
134
-
135
- global $rtTPG;
136
- if ( ! is_object( $rtTPG ) ) {
137
- $rtTPG = new rtTPG;
138
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
139
  }
1
  <?php
2
 
3
+
4
+ if (!class_exists('rtTPG')) {
5
+
6
+ class rtTPG
7
+ {
8
+ public $options;
9
+ public $post_type;
10
+ public $assetsUrl;
11
+ public $libPath;
12
+
13
+ protected static $_instance;
14
+
15
+ function __construct() {
16
+
17
+ $this->options = array(
18
+ 'settings' => 'rt_the_post_grid_settings',
19
+ 'version' => RT_THE_POST_GRID_VERSION,
20
+ 'installed_version' => 'rt_the_post_grid_current_version'
21
+ );
22
+ $this->defaultSettings = array(
23
+ 'title_tag' => 'h2',
24
+ 'custom_css' => null
25
+ );
26
+
27
+ $this->post_type = "rttpg";
28
+ $this->libPath = dirname(__FILE__);
29
+ $this->modelsPath = $this->libPath . '/models/';
30
+ $this->classesPath = $this->libPath . '/classes/';
31
+ $this->widgetsPath = $this->libPath . '/widgets/';
32
+ $this->viewsPath = $this->libPath . '/views/';
33
+ $this->assetsUrl = RT_THE_POST_GRID_PLUGIN_URL . '/assets/';
34
+
35
+ $this->rtLoadModel($this->modelsPath);
36
+ $this->rtLoadClass($this->classesPath);
37
+
38
+ }
39
+
40
+ public static function instance() {
41
+ if (is_null(self::$_instance)) {
42
+ self::$_instance = new self();
43
+ }
44
+
45
+ return self::$_instance;
46
+ }
47
+
48
+ function rtLoadModel($dir) {
49
+ if (!file_exists($dir)) {
50
+ return;
51
+ }
52
+ foreach (scandir($dir) as $item) {
53
+ if (preg_match("/.php$/i", $item)) {
54
+ require_once($dir . $item);
55
+ }
56
+ }
57
+ }
58
+
59
+ function rtLoadClass($dir) {
60
+ if (!file_exists($dir)) {
61
+ return;
62
+ }
63
+ $classes = array();
64
+ foreach (scandir($dir) as $item) {
65
+ if (preg_match("/.php$/i", $item)) {
66
+ require_once($dir . $item);
67
+ $className = str_replace(".php", "", $item);
68
+ $classes[] = new $className;
69
+ }
70
+ }
71
+ if ($classes) {
72
+ foreach ($classes as $class) {
73
+ $this->objects[] = $class;
74
+ }
75
+ }
76
+ }
77
+
78
+ function loadWidget($dir) {
79
+ if (!file_exists($dir)) {
80
+ return;
81
+ }
82
+ foreach (scandir($dir) as $item) {
83
+ if (preg_match("/.php$/i", $item)) {
84
+ require_once($dir . $item);
85
+ $class = str_replace(".php", "", $item);
86
+ if (method_exists($class, 'register_widget')) {
87
+ $caller = new $class;
88
+ $caller->register_widget();
89
+ } else {
90
+ register_widget($class);
91
+ }
92
+ }
93
+ }
94
+ }
95
+
96
+
97
+ function render($viewName, $args = array(), $return = false) {
98
+ global $rtTPG;
99
+ $path = str_replace(".", "/", $viewName);
100
+ $viewPath = $rtTPG->viewsPath . $path . '.php';
101
+ if (!file_exists($viewPath)) {
102
+ return;
103
+ }
104
+ if ($args) {
105
+ extract($args);
106
+ }
107
+ if ($return) {
108
+ ob_start();
109
+ include $viewPath;
110
+
111
+ return ob_get_clean();
112
+ }
113
+ include $viewPath;
114
+ }
115
+
116
+ /**
117
+ * Dynamicaly call any method from models class
118
+ * by pluginFramework instance
119
+ */
120
+ function __call($name, $args) {
121
+ if (!is_array($this->objects)) {
122
+ return;
123
+ }
124
+ foreach ($this->objects as $object) {
125
+ if (method_exists($object, $name)) {
126
+ $count = count($args);
127
+ if ($count == 0) {
128
+ return $object->$name();
129
+ } elseif ($count == 1) {
130
+ return $object->$name($args[0]);
131
+ } elseif ($count == 2) {
132
+ return $object->$name($args[0], $args[1]);
133
+ } elseif ($count == 3) {
134
+ return $object->$name($args[0], $args[1], $args[2]);
135
+ } elseif ($count == 4) {
136
+ return $object->$name($args[0], $args[1], $args[2], $args[3]);
137
+ } elseif ($count == 5) {
138
+ return $object->$name($args[0], $args[1], $args[2], $args[3], $args[4]);
139
+ } elseif ($count == 6) {
140
+ return $object->$name($args[0], $args[1], $args[2], $args[3], $args[4], $args[5]);
141
+ }
142
+ }
143
+ }
144
+ }
145
+ }
146
+
147
+
148
+ function rtTPG() {
149
+ global $rtTPG;
150
+ $rtTPG = rtTPG::instance();
151
+ return rtTPG::instance();
152
+ }
153
+
154
+ rtTPG();
155
  }
lib/views/settings/settings.php CHANGED
@@ -1,40 +1,37 @@
1
- <?php
2
- global $rtTPG;
3
- ?>
 
 
 
 
 
 
 
4
 
5
- <div class="wrap">
6
- <div class="width50">
7
- <div id="upf-icon-edit-pages" class="icon32 icon32-posts-page"><br/></div>
8
- <h2><?php _e( 'The Post Grid Settings', 'the-post-grid' ); ?></h2>
9
- <h3><?php _e( 'General settings', 'the-post-grid' ); ?>
10
- <a style="margin-left: 15px; font-size: 15px;"
11
- href="http://demo.radiustheme.com/wordpress/plugins/the-post-grid/"
12
- target="_blank"><?php _e( 'Documentation', 'the-post-grid' ) ?></a>
13
- </h3>
14
-
15
- <div class="rt-setting-wrapper">
16
- <div class="rt-response"></div>
17
- <form id="rt-settings-form" onsubmit="rtTPGSettings(this); return false;">
18
- <div class="rt-setting-holder">
19
  <?php echo $rtTPG->rtFieldGenerator( $rtTPG->rtTPGSettingFields(), true ); ?>
20
- </div>
21
 
22
- <p class="submit"><input type="submit" name="submit" class="button button-primary rtSaveButton"
23
- value="Save Changes"></p>
24
 
25
  <?php wp_nonce_field( $rtTPG->nonceText(), $rtTPG->nonceId() ); ?>
26
- </form>
27
 
28
- <div class="rt-response"></div>
29
- </div>
30
- </div>
31
- <div class="width50">
32
- <div class="pro-features">
33
- <h3>PRO Version Features</h3>
34
  <?php echo $rtTPG->get_pro_feature_list(); ?>
35
- <p><a href="https://www.radiustheme.com/the-post-grid-pro-for-wordpress/" class="button-link"
36
- target="_blank">Get Pro Version</a></p>
37
- </div>
38
- </div>
39
 
40
  </div>
1
+ <?php global $rtTPG; ?>
2
+ <div class="wrap rttpg-wrapper">
3
+ <div class="width50">
4
+ <div id="upf-icon-edit-pages" class="icon32 icon32-posts-page"><br/></div>
5
+ <h2><?php _e( 'The Post Grid Settings', 'the-post-grid' ); ?></h2>
6
+ <h3><?php _e( 'General settings', 'the-post-grid' ); ?>
7
+ <a style="margin-left: 15px; font-size: 15px;"
8
+ href="http://demo.radiustheme.com/wordpress/plugins/the-post-grid/"
9
+ target="_blank"><?php _e( 'Documentation', 'the-post-grid' ) ?></a>
10
+ </h3>
11
 
12
+ <div class="rt-setting-wrapper">
13
+ <div class="rt-response"></div>
14
+ <form id="rt-settings-form" onsubmit="rtTPGSettings(this); return false;">
15
+ <div class="rt-setting-holder">
 
 
 
 
 
 
 
 
 
 
16
  <?php echo $rtTPG->rtFieldGenerator( $rtTPG->rtTPGSettingFields(), true ); ?>
17
+ </div>
18
 
19
+ <p class="submit"><input type="submit" name="submit" class="button button-primary rtSaveButton"
20
+ value="Save Changes"></p>
21
 
22
  <?php wp_nonce_field( $rtTPG->nonceText(), $rtTPG->nonceId() ); ?>
23
+ </form>
24
 
25
+ <div class="rt-response"></div>
26
+ </div>
27
+ </div>
28
+ <div class="width50">
29
+ <div class="pro-features">
30
+ <h3>PRO Version Features</h3>
31
  <?php echo $rtTPG->get_pro_feature_list(); ?>
32
+ <p><a href="https://www.radiustheme.com/the-post-grid-pro-for-wordpress/" class="button-link"
33
+ target="_blank">Get Pro Version</a></p>
34
+ </div>
35
+ </div>
36
 
37
  </div>
the-post-grid.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin URI: http://demo.radiustheme.com/wordpress/plugins/the-post-grid/
5
  * Description: Fast & Easy way to display WordPress post in Grid, List & Isotope view ( filter by category, tag, author..) without a single line of coding.
6
  * Author: RadiusTheme
7
- * Version: 2.2.73
8
  * Text Domain: the-post-grid
9
  * Domain Path: /languages
10
  * Author URI: https://radiustheme.com/
4
  * Plugin URI: http://demo.radiustheme.com/wordpress/plugins/the-post-grid/
5
  * Description: Fast & Easy way to display WordPress post in Grid, List & Isotope view ( filter by category, tag, author..) without a single line of coding.
6
  * Author: RadiusTheme
7
+ * Version: 2.3.0
8
  * Text Domain: the-post-grid
9
  * Domain Path: /languages
10
  * Author URI: https://radiustheme.com/