Version Description
- Fixed pagination issue
- Fixed shortcode title tag issue
Download this release
Release Info
Developer | techlabpro1 |
Plugin | The Post Grid |
Version | 3.0.2 |
Comparing to | |
See all releases |
Code changes from version 3.0.1 to 3.0.2
- README.txt +5 -1
- assets/css/admin.css +4 -0
- assets/css/thepostgrid.css +20 -4
- assets/js/admin.js +55 -2
- languages/the-post-grid.pot +48 -44
- lib/classes/rtTPGAjaxResponse.php +5 -1
- lib/classes/rtTPGHelper.php +64 -5
- lib/classes/rtTPGOptions.php +17 -0
- lib/classes/rtTPGPreview.php +2 -0
- lib/classes/rtTPGShortCode.php +997 -1004
- lib/templates/layouts/isotope1.php +1 -1
- lib/templates/layouts/layout1.php +1 -1
- lib/templates/layouts/layout2.php +1 -1
- lib/templates/layouts/layout3.php +1 -1
- lib/views/settings/post-source.php +1 -0
- the-post-grid.php +1 -1
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.8
|
7 |
-
Stable tag: 3.0.
|
8 |
License: GPLv3
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
@@ -141,6 +141,10 @@ For any bug or suggestion please mail support@radiustheme.com
|
|
141 |
|
142 |
== Changelog ==
|
143 |
|
|
|
|
|
|
|
|
|
144 |
= 3.0.1 =
|
145 |
* Fixed isotope masonry issue
|
146 |
|
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.8
|
7 |
+
Stable tag: 3.0.2
|
8 |
License: GPLv3
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
141 |
|
142 |
== Changelog ==
|
143 |
|
144 |
+
= 3.0.2 =
|
145 |
+
* Fixed pagination issue
|
146 |
+
* Fixed shortcode title tag issue
|
147 |
+
|
148 |
= 3.0.1 =
|
149 |
* Fixed isotope masonry issue
|
150 |
|
assets/css/admin.css
CHANGED
@@ -115,6 +115,10 @@ ul.rt-tab-nav li {
|
|
115 |
margin-bottom: -1px;
|
116 |
}
|
117 |
|
|
|
|
|
|
|
|
|
118 |
ul.rt-tab-nav li:focus {
|
119 |
outline: none;
|
120 |
}
|
115 |
margin-bottom: -1px;
|
116 |
}
|
117 |
|
118 |
+
ul.rt-tab-nav li:nth-child(4) {
|
119 |
+
margin-right: 3px;
|
120 |
+
}
|
121 |
+
|
122 |
ul.rt-tab-nav li:focus {
|
123 |
outline: none;
|
124 |
}
|
assets/css/thepostgrid.css
CHANGED
@@ -1217,18 +1217,30 @@ body > .rt-tooltip .rt-tooltip-bottom:after {
|
|
1217 |
padding: 15px 0 0;
|
1218 |
}
|
1219 |
|
|
|
1220 |
.rt-tpg-container .layout1 .rt-holder .rt-detail h3,
|
|
|
|
|
1221 |
.rt-tpg-container .isotope1 .rt-holder .rt-detail h3,
|
1222 |
-
.rt-tpg-container .
|
|
|
|
|
|
|
1223 |
font-size: 26px;
|
1224 |
line-height: 1.25;
|
1225 |
margin: 0 0 18px;
|
1226 |
font-weight: 400;
|
1227 |
}
|
1228 |
|
|
|
1229 |
.rt-tpg-container .layout1 .rt-holder .rt-detail.rt-with-title h3,
|
|
|
|
|
1230 |
.rt-tpg-container .isotope1 .rt-holder .rt-detail.rt-with-title h3,
|
1231 |
-
.rt-tpg-container .
|
|
|
|
|
|
|
1232 |
margin-bottom: 5px;
|
1233 |
}
|
1234 |
|
@@ -1293,7 +1305,9 @@ body > .rt-tooltip .rt-tooltip-bottom:after {
|
|
1293 |
transform: scale(1.1);
|
1294 |
}
|
1295 |
|
1296 |
-
.rt-tpg-container .layout2 .rt-holder .rt-detail
|
|
|
|
|
1297 |
font-size: 26px;
|
1298 |
line-height: 1.25;
|
1299 |
margin: 0px 0 15px 0;
|
@@ -1343,7 +1357,9 @@ body > .rt-tooltip .rt-tooltip-bottom:after {
|
|
1343 |
margin-bottom: 20px;
|
1344 |
}
|
1345 |
|
1346 |
-
.rt-tpg-container .layout3 .rt-holder .rt-detail
|
|
|
|
|
1347 |
font-size: 26px;
|
1348 |
margin: 0px 0 18px 0;
|
1349 |
line-height: 1.25;
|
1217 |
padding: 15px 0 0;
|
1218 |
}
|
1219 |
|
1220 |
+
.rt-tpg-container .layout1 .rt-holder .rt-detail h2,
|
1221 |
.rt-tpg-container .layout1 .rt-holder .rt-detail h3,
|
1222 |
+
.rt-tpg-container .layout1 .rt-holder .rt-detail h4,
|
1223 |
+
.rt-tpg-container .isotope1 .rt-holder .rt-detail h2,
|
1224 |
.rt-tpg-container .isotope1 .rt-holder .rt-detail h3,
|
1225 |
+
.rt-tpg-container .isotope1 .rt-holder .rt-detail h4,
|
1226 |
+
.rt-tpg-container .carousel1 .rt-holder .rt-detail h2,
|
1227 |
+
.rt-tpg-container .carousel1 .rt-holder .rt-detail h3,
|
1228 |
+
.rt-tpg-container .carousel1 .rt-holder .rt-detail h4 {
|
1229 |
font-size: 26px;
|
1230 |
line-height: 1.25;
|
1231 |
margin: 0 0 18px;
|
1232 |
font-weight: 400;
|
1233 |
}
|
1234 |
|
1235 |
+
.rt-tpg-container .layout1 .rt-holder .rt-detail.rt-with-title h2,
|
1236 |
.rt-tpg-container .layout1 .rt-holder .rt-detail.rt-with-title h3,
|
1237 |
+
.rt-tpg-container .layout1 .rt-holder .rt-detail.rt-with-title h4,
|
1238 |
+
.rt-tpg-container .isotope1 .rt-holder .rt-detail.rt-with-title h2,
|
1239 |
.rt-tpg-container .isotope1 .rt-holder .rt-detail.rt-with-title h3,
|
1240 |
+
.rt-tpg-container .isotope1 .rt-holder .rt-detail.rt-with-title h4,
|
1241 |
+
.rt-tpg-container .carousel1 .rt-holder .rt-detail.rt-with-title h2,
|
1242 |
+
.rt-tpg-container .carousel1 .rt-holder .rt-detail.rt-with-title h3,
|
1243 |
+
.rt-tpg-container .carousel1 .rt-holder .rt-detail.rt-with-title h4 {
|
1244 |
margin-bottom: 5px;
|
1245 |
}
|
1246 |
|
1305 |
transform: scale(1.1);
|
1306 |
}
|
1307 |
|
1308 |
+
.rt-tpg-container .layout2 .rt-holder .rt-detail h2,
|
1309 |
+
.rt-tpg-container .layout2 .rt-holder .rt-detail h3,
|
1310 |
+
.rt-tpg-container .layout2 .rt-holder .rt-detail h4 {
|
1311 |
font-size: 26px;
|
1312 |
line-height: 1.25;
|
1313 |
margin: 0px 0 15px 0;
|
1357 |
margin-bottom: 20px;
|
1358 |
}
|
1359 |
|
1360 |
+
.rt-tpg-container .layout3 .rt-holder .rt-detail h2,
|
1361 |
+
.rt-tpg-container .layout3 .rt-holder .rt-detail h3,
|
1362 |
+
.rt-tpg-container .layout3 .rt-holder .rt-detail h4 {
|
1363 |
font-size: 26px;
|
1364 |
margin: 0px 0 18px 0;
|
1365 |
line-height: 1.25;
|
assets/js/admin.js
CHANGED
@@ -402,13 +402,46 @@
|
|
402 |
}
|
403 |
}
|
404 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
405 |
|
406 |
function setDefaultItems() {
|
407 |
var target_from = $("#rt-tpg-sc-isotope-filter"),
|
408 |
target = $("#rt-tpg-sc-isotope-default-filter"),
|
409 |
$fId = target_from.val();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
410 |
if ($fId) {
|
411 |
-
var data = 'action=defaultFilterItem&filter=' + $fId + "&rttpg_nonce=" + rttpg.nonce;
|
412 |
$.ajax({
|
413 |
type: "post",
|
414 |
url: rttpg.ajaxurl,
|
@@ -439,8 +472,28 @@
|
|
439 |
var target_from = $("#tgp_filter_taxonomy"),
|
440 |
target = $('#tgp_default_filter'),
|
441 |
$fId = target_from.val();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
442 |
if ($fId) {
|
443 |
-
var data = 'action=defaultFilterItem&filter=' + $fId + "&rttpg_nonce=" + rttpg.nonce;
|
444 |
$.ajax({
|
445 |
type: "post",
|
446 |
url: rttpg.ajaxurl,
|
402 |
}
|
403 |
}
|
404 |
|
405 |
+
$('#term_category_holder select').on('change', function (e) {
|
406 |
+
setDefaultItems();
|
407 |
+
if ($("#tgp_filter-_taxonomy_filter").is(':checked')) {
|
408 |
+
setDefaultItemsForFilter();
|
409 |
+
}
|
410 |
+
});
|
411 |
+
|
412 |
+
$('#term_post_tag_holder select').on('change', function (e) {
|
413 |
+
setDefaultItems();
|
414 |
+
if ($("#tgp_filter-_taxonomy_filter").is(':checked')) {
|
415 |
+
setDefaultItemsForFilter();
|
416 |
+
}
|
417 |
+
});
|
418 |
|
419 |
function setDefaultItems() {
|
420 |
var target_from = $("#rt-tpg-sc-isotope-filter"),
|
421 |
target = $("#rt-tpg-sc-isotope-default-filter"),
|
422 |
$fId = target_from.val();
|
423 |
+
|
424 |
+
var $term = [];
|
425 |
+
|
426 |
+
if ($fId == 'category') {
|
427 |
+
if ($('#term_category_holder').length && $('#post-taxonomy-category')) {
|
428 |
+
var selected_term = $('#term_category_holder select').select2('data');
|
429 |
+
selected_term.forEach(function (element){
|
430 |
+
$term.push(element.id);
|
431 |
+
});
|
432 |
+
}
|
433 |
+
} else if ($fId == 'post_tag') {
|
434 |
+
$term = [];
|
435 |
+
if ($('#term_post_tag_holder').length && $('#post-taxonomy-post_tag')) {
|
436 |
+
var selected_term = $('#term_post_tag_holder select').select2('data');
|
437 |
+
selected_term.forEach(function (element){
|
438 |
+
$term.push(element.id);
|
439 |
+
});
|
440 |
+
}
|
441 |
+
}
|
442 |
+
|
443 |
if ($fId) {
|
444 |
+
var data = 'action=defaultFilterItem&filter=' + $fId + '&include=' + $term + "&rttpg_nonce=" + rttpg.nonce;
|
445 |
$.ajax({
|
446 |
type: "post",
|
447 |
url: rttpg.ajaxurl,
|
472 |
var target_from = $("#tgp_filter_taxonomy"),
|
473 |
target = $('#tgp_default_filter'),
|
474 |
$fId = target_from.val();
|
475 |
+
|
476 |
+
var $term = [];
|
477 |
+
|
478 |
+
if ($fId == 'category') {
|
479 |
+
if ($('#term_category_holder').length && $('#post-taxonomy-category')) {
|
480 |
+
var selected_term = $('#term_category_holder select').select2('data');
|
481 |
+
selected_term.forEach(function (element){
|
482 |
+
$term.push(element.id);
|
483 |
+
});
|
484 |
+
}
|
485 |
+
} else if ($fId == 'post_tag') {
|
486 |
+
$term = [];
|
487 |
+
if ($('#term_post_tag_holder').length && $('#post-taxonomy-post_tag')) {
|
488 |
+
var selected_term = $('#term_post_tag_holder select').select2('data');
|
489 |
+
selected_term.forEach(function (element){
|
490 |
+
$term.push(element.id);
|
491 |
+
});
|
492 |
+
}
|
493 |
+
}
|
494 |
+
|
495 |
if ($fId) {
|
496 |
+
var data = 'action=defaultFilterItem&filter=' + $fId + '&include=' + $term + "&rttpg_nonce=" + rttpg.nonce;
|
497 |
$.ajax({
|
498 |
type: "post",
|
499 |
url: rttpg.ajaxurl,
|
languages/the-post-grid.pot
CHANGED
@@ -29,39 +29,39 @@ msgstr ""
|
|
29 |
msgid "Server Error !!"
|
30 |
msgstr ""
|
31 |
|
32 |
-
#: ../lib/classes/rtTPGAjaxResponse.php:
|
33 |
msgid "Session Error !!"
|
34 |
msgstr ""
|
35 |
|
36 |
-
#: ../lib/classes/rtTPGAjaxResponse.php:
|
37 |
msgid "Success"
|
38 |
msgstr ""
|
39 |
|
40 |
-
#: ../lib/classes/rtTPGAjaxResponse.php:
|
41 |
msgid "Show All"
|
42 |
msgstr ""
|
43 |
|
44 |
-
#: ../lib/classes/rtTPGAjaxResponse.php:
|
45 |
msgid "Settings successfully updated"
|
46 |
msgstr ""
|
47 |
|
48 |
-
#: ../lib/classes/rtTPGAjaxResponse.php:
|
49 |
msgid "Security error"
|
50 |
msgstr ""
|
51 |
|
52 |
-
#: ../lib/classes/rtTPGAjaxResponse.php:
|
53 |
msgid "<div class=\"field-holder\">No Taxonomy found</div>"
|
54 |
msgstr ""
|
55 |
|
56 |
-
#: ../lib/classes/rtTPGAjaxResponse.php:
|
57 |
msgid "No shortCode found."
|
58 |
msgstr ""
|
59 |
|
60 |
-
#: ../lib/classes/rtTPGAjaxResponse.php:
|
61 |
msgid "Select Short code"
|
62 |
msgstr ""
|
63 |
|
64 |
-
#: ../lib/classes/rtTPGAjaxResponse.php:
|
65 |
msgid "Default"
|
66 |
msgstr ""
|
67 |
|
@@ -181,7 +181,7 @@ msgstr ""
|
|
181 |
msgid "OR — show posts which match one or more settings"
|
182 |
msgstr ""
|
183 |
|
184 |
-
#: ../lib/classes/rtTPGOptions.php:50, ../lib/classes/rtTPGPreview.php:
|
185 |
msgid "Meta value"
|
186 |
msgstr ""
|
187 |
|
@@ -309,95 +309,99 @@ msgstr ""
|
|
309 |
msgid "Excerpt Type"
|
310 |
msgstr ""
|
311 |
|
312 |
-
#: ../lib/classes/rtTPGOptions.php:
|
|
|
|
|
|
|
|
|
313 |
msgid "Read more button border radius"
|
314 |
msgstr ""
|
315 |
|
316 |
-
#: ../lib/classes/rtTPGOptions.php:
|
317 |
msgid "Leave it blank for default"
|
318 |
msgstr ""
|
319 |
|
320 |
-
#: ../lib/classes/rtTPGOptions.php:
|
321 |
msgid "Read more button alignment"
|
322 |
msgstr ""
|
323 |
|
324 |
-
#: ../lib/classes/rtTPGOptions.php:
|
325 |
msgid "Left"
|
326 |
msgstr ""
|
327 |
|
328 |
-
#: ../lib/classes/rtTPGOptions.php:
|
329 |
msgid "Right"
|
330 |
msgstr ""
|
331 |
|
332 |
-
#: ../lib/classes/rtTPGOptions.php:
|
333 |
msgid "Center"
|
334 |
msgstr ""
|
335 |
|
336 |
-
#: ../lib/classes/rtTPGOptions.php:
|
337 |
msgid "Title Position (Above or Below image)"
|
338 |
msgstr ""
|
339 |
|
340 |
-
#: ../lib/classes/rtTPGOptions.php:
|
341 |
msgid "Above image"
|
342 |
msgstr ""
|
343 |
|
344 |
-
#: ../lib/classes/rtTPGOptions.php:
|
345 |
msgid "Below image"
|
346 |
msgstr ""
|
347 |
|
348 |
-
#: ../lib/classes/rtTPGOptions.php:
|
349 |
msgid "<span style='color:red'>Only Layout 1, Layout 12, Layout 14, Isotope1, Isotope8, Isotope10, Carousel Layout 1, Carousel Layout 8, Carousel Layout 10</span>"
|
350 |
msgstr ""
|
351 |
|
352 |
-
#: ../lib/classes/rtTPGOptions.php:
|
353 |
msgid "Character"
|
354 |
msgstr ""
|
355 |
|
356 |
-
#: ../lib/classes/rtTPGOptions.php:
|
357 |
msgid "Word"
|
358 |
msgstr ""
|
359 |
|
360 |
-
#: ../lib/classes/rtTPGOptions.php:
|
361 |
msgid "Full Content"
|
362 |
msgstr ""
|
363 |
|
364 |
-
#: ../lib/classes/rtTPGOptions.php:
|
365 |
msgid "Taxonomy filter"
|
366 |
msgstr ""
|
367 |
|
368 |
-
#: ../lib/classes/rtTPGOptions.php:
|
369 |
msgid "Author filter"
|
370 |
msgstr ""
|
371 |
|
372 |
-
#: ../lib/classes/rtTPGOptions.php:
|
373 |
msgid "Order - Sort retrieved posts by parameter"
|
374 |
msgstr ""
|
375 |
|
376 |
-
#: ../lib/classes/rtTPGOptions.php:
|
377 |
msgid "Sort Order - Designates the ascending or descending order of the \"orderby\" parameter"
|
378 |
msgstr ""
|
379 |
|
380 |
-
#: ../lib/classes/rtTPGOptions.php:
|
381 |
msgid "Search filter"
|
382 |
msgstr ""
|
383 |
|
384 |
-
#: ../lib/classes/rtTPGOptions.php:
|
385 |
msgid "Layout 1"
|
386 |
msgstr ""
|
387 |
|
388 |
-
#: ../lib/classes/rtTPGOptions.php:
|
389 |
msgid "Layout 2"
|
390 |
msgstr ""
|
391 |
|
392 |
-
#: ../lib/classes/rtTPGOptions.php:
|
393 |
msgid "Layout 3"
|
394 |
msgstr ""
|
395 |
|
396 |
-
#: ../lib/classes/rtTPGOptions.php:
|
397 |
msgid "Isotope Layout"
|
398 |
msgstr ""
|
399 |
|
400 |
-
#: ../lib/classes/rtTPGOptions.php:
|
401 |
msgid "Get Pro Version"
|
402 |
msgstr ""
|
403 |
|
@@ -405,43 +409,43 @@ msgstr ""
|
|
405 |
msgid "Read More"
|
406 |
msgstr ""
|
407 |
|
408 |
-
#: ../lib/classes/rtTPGPreview.php:
|
409 |
msgid "All"
|
410 |
msgstr ""
|
411 |
|
412 |
-
#: ../lib/classes/rtTPGPreview.php:
|
413 |
msgid "Sort By None"
|
414 |
msgstr ""
|
415 |
|
416 |
-
#: ../lib/classes/rtTPGPreview.php:
|
417 |
msgid "Search..."
|
418 |
msgstr ""
|
419 |
|
420 |
-
#: ../lib/classes/rtTPGPreview.php:
|
421 |
msgid "Loading ..."
|
422 |
msgstr ""
|
423 |
|
424 |
-
#: ../lib/classes/rtTPGPreview.php:
|
425 |
msgid "No post found"
|
426 |
msgstr ""
|
427 |
|
428 |
-
#: ../lib/classes/rtTPGPreview.php:
|
429 |
msgid "Search"
|
430 |
msgstr ""
|
431 |
|
432 |
-
#: ../lib/classes/rtTPGPreview.php:
|
433 |
msgid "Load More"
|
434 |
msgstr ""
|
435 |
|
436 |
-
#: ../lib/classes/rtTPGShortCode.php:
|
437 |
msgid "No shortCode found"
|
438 |
msgstr ""
|
439 |
|
440 |
-
#: ../lib/classes/rtTPGShortCode.php:
|
441 |
msgid "This is a restricted content, you need to logged in to view this content."
|
442 |
msgstr ""
|
443 |
|
444 |
-
#: ../lib/classes/rtTPGShortCode.php:
|
445 |
msgid "You are not permitted to view this content."
|
446 |
msgstr ""
|
447 |
|
@@ -473,7 +477,7 @@ msgstr ""
|
|
473 |
msgid "Select post grid"
|
474 |
msgstr ""
|
475 |
|
476 |
-
#: ../lib/views/settings/post-source.php:
|
477 |
msgid "If \"Meta value\", \"Meta value Number\" or \"Meta value datetime\" is chosen then meta key is required."
|
478 |
msgstr ""
|
479 |
|
29 |
msgid "Server Error !!"
|
30 |
msgstr ""
|
31 |
|
32 |
+
#: ../lib/classes/rtTPGAjaxResponse.php:71, ../lib/classes/rtTPGAjaxResponse.php:98, ../lib/classes/rtTPGPreview.php:940
|
33 |
msgid "Session Error !!"
|
34 |
msgstr ""
|
35 |
|
36 |
+
#: ../lib/classes/rtTPGAjaxResponse.php:61
|
37 |
msgid "Success"
|
38 |
msgstr ""
|
39 |
|
40 |
+
#: ../lib/classes/rtTPGAjaxResponse.php:62, ../lib/classes/rtTPGOptions.php:352
|
41 |
msgid "Show All"
|
42 |
msgstr ""
|
43 |
|
44 |
+
#: ../lib/classes/rtTPGAjaxResponse.php:93
|
45 |
msgid "Settings successfully updated"
|
46 |
msgstr ""
|
47 |
|
48 |
+
#: ../lib/classes/rtTPGAjaxResponse.php:129, ../lib/classes/rtTPGAjaxResponse.php:148, ../lib/classes/rtTPGAjaxResponse.php:189
|
49 |
msgid "Security error"
|
50 |
msgstr ""
|
51 |
|
52 |
+
#: ../lib/classes/rtTPGAjaxResponse.php:125
|
53 |
msgid "<div class=\"field-holder\">No Taxonomy found</div>"
|
54 |
msgstr ""
|
55 |
|
56 |
+
#: ../lib/classes/rtTPGAjaxResponse.php:215
|
57 |
msgid "No shortCode found."
|
58 |
msgstr ""
|
59 |
|
60 |
+
#: ../lib/classes/rtTPGAjaxResponse.php:204
|
61 |
msgid "Select Short code"
|
62 |
msgstr ""
|
63 |
|
64 |
+
#: ../lib/classes/rtTPGAjaxResponse.php:206, ../lib/classes/rtTPGOptions.php:793, ../lib/classes/rtTPGOptions.php:805
|
65 |
msgid "Default"
|
66 |
msgstr ""
|
67 |
|
181 |
msgid "OR — show posts which match one or more settings"
|
182 |
msgstr ""
|
183 |
|
184 |
+
#: ../lib/classes/rtTPGOptions.php:50, ../lib/classes/rtTPGPreview.php:657, ../lib/classes/rtTPGShortCode.php:695
|
185 |
msgid "Meta value"
|
186 |
msgstr ""
|
187 |
|
309 |
msgid "Excerpt Type"
|
310 |
msgstr ""
|
311 |
|
312 |
+
#: ../lib/classes/rtTPGOptions.php:586
|
313 |
+
msgid "Title tag"
|
314 |
+
msgstr ""
|
315 |
+
|
316 |
+
#: ../lib/classes/rtTPGOptions.php:786
|
317 |
msgid "Read more button border radius"
|
318 |
msgstr ""
|
319 |
|
320 |
+
#: ../lib/classes/rtTPGOptions.php:787
|
321 |
msgid "Leave it blank for default"
|
322 |
msgstr ""
|
323 |
|
324 |
+
#: ../lib/classes/rtTPGOptions.php:792
|
325 |
msgid "Read more button alignment"
|
326 |
msgstr ""
|
327 |
|
328 |
+
#: ../lib/classes/rtTPGOptions.php:795
|
329 |
msgid "Left"
|
330 |
msgstr ""
|
331 |
|
332 |
+
#: ../lib/classes/rtTPGOptions.php:796
|
333 |
msgid "Right"
|
334 |
msgstr ""
|
335 |
|
336 |
+
#: ../lib/classes/rtTPGOptions.php:797
|
337 |
msgid "Center"
|
338 |
msgstr ""
|
339 |
|
340 |
+
#: ../lib/classes/rtTPGOptions.php:802
|
341 |
msgid "Title Position (Above or Below image)"
|
342 |
msgstr ""
|
343 |
|
344 |
+
#: ../lib/classes/rtTPGOptions.php:807
|
345 |
msgid "Above image"
|
346 |
msgstr ""
|
347 |
|
348 |
+
#: ../lib/classes/rtTPGOptions.php:808
|
349 |
msgid "Below image"
|
350 |
msgstr ""
|
351 |
|
352 |
+
#: ../lib/classes/rtTPGOptions.php:810
|
353 |
msgid "<span style='color:red'>Only Layout 1, Layout 12, Layout 14, Isotope1, Isotope8, Isotope10, Carousel Layout 1, Carousel Layout 8, Carousel Layout 10</span>"
|
354 |
msgstr ""
|
355 |
|
356 |
+
#: ../lib/classes/rtTPGOptions.php:893
|
357 |
msgid "Character"
|
358 |
msgstr ""
|
359 |
|
360 |
+
#: ../lib/classes/rtTPGOptions.php:894
|
361 |
msgid "Word"
|
362 |
msgstr ""
|
363 |
|
364 |
+
#: ../lib/classes/rtTPGOptions.php:897
|
365 |
msgid "Full Content"
|
366 |
msgstr ""
|
367 |
|
368 |
+
#: ../lib/classes/rtTPGOptions.php:916
|
369 |
msgid "Taxonomy filter"
|
370 |
msgstr ""
|
371 |
|
372 |
+
#: ../lib/classes/rtTPGOptions.php:917
|
373 |
msgid "Author filter"
|
374 |
msgstr ""
|
375 |
|
376 |
+
#: ../lib/classes/rtTPGOptions.php:918
|
377 |
msgid "Order - Sort retrieved posts by parameter"
|
378 |
msgstr ""
|
379 |
|
380 |
+
#: ../lib/classes/rtTPGOptions.php:919
|
381 |
msgid "Sort Order - Designates the ascending or descending order of the \"orderby\" parameter"
|
382 |
msgstr ""
|
383 |
|
384 |
+
#: ../lib/classes/rtTPGOptions.php:920
|
385 |
msgid "Search filter"
|
386 |
msgstr ""
|
387 |
|
388 |
+
#: ../lib/classes/rtTPGOptions.php:940
|
389 |
msgid "Layout 1"
|
390 |
msgstr ""
|
391 |
|
392 |
+
#: ../lib/classes/rtTPGOptions.php:941
|
393 |
msgid "Layout 2"
|
394 |
msgstr ""
|
395 |
|
396 |
+
#: ../lib/classes/rtTPGOptions.php:942
|
397 |
msgid "Layout 3"
|
398 |
msgstr ""
|
399 |
|
400 |
+
#: ../lib/classes/rtTPGOptions.php:943
|
401 |
msgid "Isotope Layout"
|
402 |
msgstr ""
|
403 |
|
404 |
+
#: ../lib/classes/rtTPGOptions.php:1068
|
405 |
msgid "Get Pro Version"
|
406 |
msgstr ""
|
407 |
|
409 |
msgid "Read More"
|
410 |
msgstr ""
|
411 |
|
412 |
+
#: ../lib/classes/rtTPGPreview.php:421, ../lib/classes/rtTPGShortCode.php:462
|
413 |
msgid "All"
|
414 |
msgstr ""
|
415 |
|
416 |
+
#: ../lib/classes/rtTPGPreview.php:655, ../lib/classes/rtTPGPreview.php:662, ../lib/classes/rtTPGShortCode.php:693, ../lib/classes/rtTPGShortCode.php:700
|
417 |
msgid "Sort By None"
|
418 |
msgstr ""
|
419 |
|
420 |
+
#: ../lib/classes/rtTPGPreview.php:680, ../lib/classes/rtTPGShortCode.php:718
|
421 |
msgid "Search..."
|
422 |
msgstr ""
|
423 |
|
424 |
+
#: ../lib/classes/rtTPGPreview.php:688, ../lib/classes/rtTPGShortCode.php:726
|
425 |
msgid "Loading ..."
|
426 |
msgstr ""
|
427 |
|
428 |
+
#: ../lib/classes/rtTPGPreview.php:869, ../lib/classes/rtTPGShortCode.php:898
|
429 |
msgid "No post found"
|
430 |
msgstr ""
|
431 |
|
432 |
+
#: ../lib/classes/rtTPGPreview.php:772, ../lib/classes/rtTPGShortCode.php:807
|
433 |
msgid "Search"
|
434 |
msgstr ""
|
435 |
|
436 |
+
#: ../lib/classes/rtTPGPreview.php:903, ../lib/classes/rtTPGPreview.php:898, ../lib/classes/rtTPGShortCode.php:924
|
437 |
msgid "Load More"
|
438 |
msgstr ""
|
439 |
|
440 |
+
#: ../lib/classes/rtTPGShortCode.php:962
|
441 |
msgid "No shortCode found"
|
442 |
msgstr ""
|
443 |
|
444 |
+
#: ../lib/classes/rtTPGShortCode.php:982
|
445 |
msgid "This is a restricted content, you need to logged in to view this content."
|
446 |
msgstr ""
|
447 |
|
448 |
+
#: ../lib/classes/rtTPGShortCode.php:976
|
449 |
msgid "You are not permitted to view this content."
|
450 |
msgstr ""
|
451 |
|
477 |
msgid "Select post grid"
|
478 |
msgstr ""
|
479 |
|
480 |
+
#: ../lib/views/settings/post-source.php:140
|
481 |
msgid "If \"Meta value\", \"Meta value Number\" or \"Meta value datetime\" is chosen then meta key is required."
|
482 |
msgstr ""
|
483 |
|
lib/classes/rtTPGAjaxResponse.php
CHANGED
@@ -53,10 +53,14 @@ if (!class_exists('rtTPGAjaxResponse')):
|
|
53 |
$data = $msg = null;
|
54 |
if (rtTPG()->verifyNonce()) {
|
55 |
if ($filter = $_REQUEST['filter']) {
|
|
|
|
|
|
|
|
|
56 |
$error = false;
|
57 |
$msg = __('Success', 'the-post-grid');
|
58 |
$data .= "<option value=''>" . __('Show All', 'the-post-grid') . "</option>";
|
59 |
-
$items = rtTPG()->
|
60 |
if (!empty($items)) {
|
61 |
foreach ($items as $id => $item) {
|
62 |
$data .= "<option value='{$id}'>{$item}</option>";
|
53 |
$data = $msg = null;
|
54 |
if (rtTPG()->verifyNonce()) {
|
55 |
if ($filter = $_REQUEST['filter']) {
|
56 |
+
$include = [];
|
57 |
+
if(isset($_REQUEST['include']) && $term = $_REQUEST['include']) {
|
58 |
+
$include = explode(',', $term);
|
59 |
+
}
|
60 |
$error = false;
|
61 |
$msg = __('Success', 'the-post-grid');
|
62 |
$data .= "<option value=''>" . __('Show All', 'the-post-grid') . "</option>";
|
63 |
+
$items = rtTPG()->rt_get_selected_term_by_taxonomy($filter, $include, '', 0);
|
64 |
if (!empty($items)) {
|
65 |
foreach ($items as $id => $item) {
|
66 |
$data .= "<option value='{$id}'>{$item}</option>";
|
lib/classes/rtTPGHelper.php
CHANGED
@@ -74,6 +74,46 @@ if (!class_exists('rtTPGHelper')):
|
|
74 |
return $terms;
|
75 |
}
|
76 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
function getCurrentUserRoles() {
|
78 |
global $current_user;
|
79 |
|
@@ -459,7 +499,7 @@ if (!class_exists('rtTPGHelper')):
|
|
459 |
|
460 |
if ($mediaSource == 'feature_image') {
|
461 |
if ($aID = get_post_thumbnail_id($post_id)) {
|
462 |
-
$image = wp_get_attachment_image($aID, $fImgSize, '', ['class' => $img_class]);
|
463 |
$imgSrc = wp_get_attachment_image_src($aID, $fImgSize);
|
464 |
$imgSrc = $imgSrc[0];
|
465 |
}
|
@@ -1085,7 +1125,18 @@ if (!class_exists('rtTPGHelper')):
|
|
1085 |
// Title decoration
|
1086 |
|
1087 |
if ($title_color || $title_size || $title_weight || $title_alignment) {
|
1088 |
-
$css .= "#{$layoutID} .{$layout} .rt-holder
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1089 |
if ($title_color) {
|
1090 |
$css .= "color:" . $title_color . ";";
|
1091 |
}
|
@@ -1103,10 +1154,18 @@ if (!class_exists('rtTPGHelper')):
|
|
1103 |
|
1104 |
// Title hover color
|
1105 |
if ($title_hover_color) {
|
1106 |
-
$css .= "#{$layoutID} .{$layout} .rt-holder
|
|
|
|
|
|
|
1107 |
#{$layoutID} .{$layout} .rt-holder h3.entry-title a:hover,
|
|
|
|
|
1108 |
#{$layoutID} .rt-holder .rt-woo-info h3 a:hover,
|
1109 |
-
#{$layoutID} .rt-holder .rt-woo-info
|
|
|
|
|
|
|
1110 |
$css .= "color:" . $title_hover_color . " !important;";
|
1111 |
$css .= "}";
|
1112 |
}
|
@@ -1137,7 +1196,7 @@ if (!class_exists('rtTPGHelper')):
|
|
1137 |
$css .= "}";
|
1138 |
}
|
1139 |
|
1140 |
-
$css .= "#{$layoutID} .{$layout} .rt-holder .post-meta-user,#{$layoutID} .{$layout} .rt-holder .post-meta-user .meta-data, #{$layoutID} .{$layout} .rt-holder .post-meta-user a{";
|
1141 |
if ($meta_data_color) {
|
1142 |
$css .= "color:" . $meta_data_color . ";";
|
1143 |
}
|
74 |
return $terms;
|
75 |
}
|
76 |
|
77 |
+
function rt_get_selected_term_by_taxonomy($taxonomy = null, $include = [], $count = false, $parent = false) {
|
78 |
+
$terms = array();
|
79 |
+
if ($taxonomy) {
|
80 |
+
$temp_terms = get_terms(array('taxonomy' => $taxonomy, 'hide_empty' => 0));
|
81 |
+
if (is_array($temp_terms) && !empty($temp_terms) && empty($temp_terms['errors'])) {
|
82 |
+
foreach ($temp_terms as $term) {
|
83 |
+
$order = get_term_meta($term->term_id, '_rt_order', true);
|
84 |
+
if ($order === "") {
|
85 |
+
update_term_meta($term->term_id, '_rt_order', 0);
|
86 |
+
}
|
87 |
+
}
|
88 |
+
global $wp_version;
|
89 |
+
$args = array(
|
90 |
+
'taxonomy' => $taxonomy,
|
91 |
+
'orderby' => 'meta_value_num',
|
92 |
+
'meta_key' => '_rt_order',
|
93 |
+
'include' => $include,
|
94 |
+
'hide_empty' => false,
|
95 |
+
);
|
96 |
+
if ($parent >= 0 && $parent !== false) {
|
97 |
+
$args['parent'] = absint($parent);
|
98 |
+
}
|
99 |
+
$args['orderby'] = 'meta_value_num';
|
100 |
+
$args['meta_key'] = '_rt_order';
|
101 |
+
|
102 |
+
$termObjs = get_terms($args);
|
103 |
+
|
104 |
+
foreach ($termObjs as $term) {
|
105 |
+
if ($count) {
|
106 |
+
$terms[$term->term_id] = array('name' => $term->name, 'count' => $term->count);
|
107 |
+
} else {
|
108 |
+
$terms[$term->term_id] = $term->name;
|
109 |
+
}
|
110 |
+
}
|
111 |
+
}
|
112 |
+
}
|
113 |
+
|
114 |
+
return $terms;
|
115 |
+
}
|
116 |
+
|
117 |
function getCurrentUserRoles() {
|
118 |
global $current_user;
|
119 |
|
499 |
|
500 |
if ($mediaSource == 'feature_image') {
|
501 |
if ($aID = get_post_thumbnail_id($post_id)) {
|
502 |
+
$image = wp_get_attachment_image($aID, $fImgSize, '', ['class' => $img_class, 'loading' => false]);
|
503 |
$imgSrc = wp_get_attachment_image_src($aID, $fImgSize);
|
504 |
$imgSrc = $imgSrc[0];
|
505 |
}
|
1125 |
// Title decoration
|
1126 |
|
1127 |
if ($title_color || $title_size || $title_weight || $title_alignment) {
|
1128 |
+
$css .= "#{$layoutID} .{$layout} .rt-holder h2.entry-title,
|
1129 |
+
#{$layoutID} .{$layout} .rt-holder h3.entry-title,
|
1130 |
+
#{$layoutID} .{$layout} .rt-holder h4.entry-title,
|
1131 |
+
#{$layoutID} .{$layout} .rt-holder h2.entry-title a,
|
1132 |
+
#{$layoutID} .{$layout} .rt-holder h3.entry-title a,
|
1133 |
+
#{$layoutID} .{$layout} .rt-holder h4.entry-title a,
|
1134 |
+
#{$layoutID} .rt-holder .rt-woo-info h2 a,
|
1135 |
+
#{$layoutID} .rt-holder .rt-woo-info h3 a,
|
1136 |
+
#{$layoutID} .rt-holder .rt-woo-info h4 a,
|
1137 |
+
#{$layoutID} .rt-holder .rt-woo-info h2,
|
1138 |
+
#{$layoutID} .rt-holder .rt-woo-info h3,
|
1139 |
+
#{$layoutID} .rt-holder .rt-woo-info h4{";
|
1140 |
if ($title_color) {
|
1141 |
$css .= "color:" . $title_color . ";";
|
1142 |
}
|
1154 |
|
1155 |
// Title hover color
|
1156 |
if ($title_hover_color) {
|
1157 |
+
$css .= "#{$layoutID} .{$layout} .rt-holder h2.entry-title:hover,
|
1158 |
+
#{$layoutID} .{$layout} .rt-holder h3.entry-title:hover,
|
1159 |
+
#{$layoutID} .{$layout} .rt-holder h4.entry-title:hover,
|
1160 |
+
#{$layoutID} .{$layout} .rt-holder h2.entry-title a:hover,
|
1161 |
#{$layoutID} .{$layout} .rt-holder h3.entry-title a:hover,
|
1162 |
+
#{$layoutID} .{$layout} .rt-holder h4.entry-title a:hover,
|
1163 |
+
#{$layoutID} .rt-holder .rt-woo-info h2 a:hover,
|
1164 |
#{$layoutID} .rt-holder .rt-woo-info h3 a:hover,
|
1165 |
+
#{$layoutID} .rt-holder .rt-woo-info h4 a:hover,
|
1166 |
+
#{$layoutID} .rt-holder .rt-woo-info h2:hover,
|
1167 |
+
#{$layoutID} .rt-holder .rt-woo-info h3:hover,
|
1168 |
+
#{$layoutID} .rt-holder .rt-woo-info h4:hover{";
|
1169 |
$css .= "color:" . $title_hover_color . " !important;";
|
1170 |
$css .= "}";
|
1171 |
}
|
1196 |
$css .= "}";
|
1197 |
}
|
1198 |
|
1199 |
+
$css .= "#{$layoutID} .{$layout} .rt-holder .post-meta-user,#{$layoutID} .{$layout} .rt-holder .post-meta-user .meta-data, #{$layoutID} .{$layout} .rt-holder .post-meta-user a, #{$layoutID} .{$layout} .rt-holder .rt-detail .post-meta .rt-tpg-social-share {";
|
1200 |
if ($meta_data_color) {
|
1201 |
$css .= "color:" . $meta_data_color . ";";
|
1202 |
}
|
lib/classes/rtTPGOptions.php
CHANGED
@@ -580,6 +580,15 @@ if (!class_exists('rtTPGOptions')):
|
|
580 |
"type" => "text",
|
581 |
"label" => "Read more text"
|
582 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
583 |
'link_to_detail_page' => array(
|
584 |
"type" => "radio",
|
585 |
"label" => "Link To Detail Page",
|
@@ -641,6 +650,14 @@ if (!class_exists('rtTPGOptions')):
|
|
641 |
);
|
642 |
}
|
643 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
644 |
function rtTpgSettingsDetailFieldSelection() {
|
645 |
$settings = get_option(rtTPG()->options['settings']);
|
646 |
|
580 |
"type" => "text",
|
581 |
"label" => "Read more text"
|
582 |
),
|
583 |
+
'title_tag' => array(
|
584 |
+
'type' => 'select',
|
585 |
+
'name' => 'title_tag',
|
586 |
+
'label' => esc_html__('Title tag', 'the-post-grid'),
|
587 |
+
'class' => 'rt-select2',
|
588 |
+
'id' => 'title-tag',
|
589 |
+
'options' => $this->getTitleTags(),
|
590 |
+
'default' => 'h3'
|
591 |
+
),
|
592 |
'link_to_detail_page' => array(
|
593 |
"type" => "radio",
|
594 |
"label" => "Link To Detail Page",
|
650 |
);
|
651 |
}
|
652 |
|
653 |
+
function getTitleTags() {
|
654 |
+
return array(
|
655 |
+
'h2' => "H2",
|
656 |
+
'h3' => "H3",
|
657 |
+
'h4' => "H4"
|
658 |
+
);
|
659 |
+
}
|
660 |
+
|
661 |
function rtTpgSettingsDetailFieldSelection() {
|
662 |
$settings = get_option(rtTPG()->options['settings']);
|
663 |
|
lib/classes/rtTPGPreview.php
CHANGED
@@ -408,6 +408,8 @@ if ( ! class_exists( 'rtTPGPreview' ) ):
|
|
408 |
);
|
409 |
}
|
410 |
|
|
|
|
|
411 |
$gridQuery = new WP_Query( $args );
|
412 |
// Start layout
|
413 |
$data .= rtTPG()->layoutStyle( $layoutID, $scMeta, $layout );
|
408 |
);
|
409 |
}
|
410 |
|
411 |
+
$arg['title_tag'] = (!empty($scMeta['title_tag']) && in_array($scMeta['title_tag'], array_keys(rtTPG()->getTitleTags()))) ? esc_attr($scMeta['title_tag']) : 'h3';
|
412 |
+
|
413 |
$gridQuery = new WP_Query( $args );
|
414 |
// Start layout
|
415 |
$data .= rtTPG()->layoutStyle( $layoutID, $scMeta, $layout );
|
lib/classes/rtTPGShortCode.php
CHANGED
@@ -1,1004 +1,997 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
if (!class_exists('rtTPGShortCode')):
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
<div class="md-content">
|
71 |
-
<div class="rt-md-content-holder">
|
72 |
-
|
73 |
-
</div>
|
74 |
-
<div class="md-cls-btn">
|
75 |
-
<button class="md-close"><i class="fa fa-times" aria-hidden="true"></i></button>
|
76 |
-
</div>
|
77 |
-
</div>
|
78 |
-
</div>';
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
|
588 |
-
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
|
642 |
-
|
643 |
-
|
644 |
-
|
645 |
-
|
646 |
-
|
647 |
-
|
648 |
-
|
649 |
-
|
650 |
-
|
651 |
-
|
652 |
-
|
653 |
-
|
654 |
-
|
655 |
-
|
656 |
-
|
657 |
-
|
658 |
-
|
659 |
-
|
660 |
-
|
661 |
-
|
662 |
-
|
663 |
-
|
664 |
-
|
665 |
-
|
666 |
-
|
667 |
-
|
668 |
-
|
669 |
-
|
670 |
-
|
671 |
-
|
672 |
-
|
673 |
-
|
674 |
-
|
675 |
-
|
676 |
-
|
677 |
-
|
678 |
-
|
679 |
-
|
680 |
-
|
681 |
-
|
682 |
-
|
683 |
-
|
684 |
-
|
685 |
-
|
686 |
-
|
687 |
-
|
688 |
-
|
689 |
-
|
690 |
-
|
691 |
-
|
692 |
-
|
693 |
-
|
694 |
-
|
695 |
-
|
696 |
-
|
697 |
-
|
698 |
-
|
699 |
-
|
700 |
-
|
701 |
-
|
702 |
-
|
703 |
-
|
704 |
-
|
705 |
-
|
706 |
-
|
707 |
-
|
708 |
-
|
709 |
-
|
710 |
-
|
711 |
-
|
712 |
-
|
713 |
-
|
714 |
-
|
715 |
-
|
716 |
-
|
717 |
-
|
718 |
-
|
719 |
-
|
720 |
-
|
721 |
-
|
722 |
-
|
723 |
-
|
724 |
-
|
725 |
-
|
726 |
-
|
727 |
-
|
728 |
-
|
729 |
-
|
730 |
-
|
731 |
-
|
732 |
-
|
733 |
-
|
734 |
-
|
735 |
-
|
736 |
-
|
737 |
-
|
738 |
-
|
739 |
-
|
740 |
-
|
741 |
-
|
742 |
-
|
743 |
-
|
744 |
-
|
745 |
-
|
746 |
-
|
747 |
-
|
748 |
-
|
749 |
-
|
750 |
-
|
751 |
-
|
752 |
-
|
753 |
-
|
754 |
-
|
755 |
-
|
756 |
-
|
757 |
-
|
758 |
-
|
759 |
-
|
760 |
-
|
761 |
-
|
762 |
-
|
763 |
-
|
764 |
-
|
765 |
-
|
766 |
-
|
767 |
-
|
768 |
-
|
769 |
-
|
770 |
-
|
771 |
-
|
772 |
-
|
773 |
-
|
774 |
-
|
775 |
-
|
776 |
-
|
777 |
-
|
778 |
-
|
779 |
-
|
780 |
-
|
781 |
-
|
782 |
-
|
783 |
-
|
784 |
-
|
785 |
-
|
786 |
-
|
787 |
-
|
788 |
-
|
789 |
-
|
790 |
-
|
791 |
-
|
792 |
-
|
793 |
-
|
794 |
-
|
795 |
-
|
796 |
-
|
797 |
-
|
798 |
-
|
799 |
-
|
800 |
-
|
801 |
-
|
802 |
-
|
803 |
-
|
804 |
-
|
805 |
-
|
806 |
-
|
807 |
-
|
808 |
-
|
809 |
-
|
810 |
-
|
811 |
-
|
812 |
-
|
813 |
-
|
814 |
-
|
815 |
-
|
816 |
-
|
817 |
-
|
818 |
-
|
819 |
-
|
820 |
-
|
821 |
-
|
822 |
-
|
823 |
-
|
824 |
-
|
825 |
-
|
826 |
-
|
827 |
-
|
828 |
-
|
829 |
-
|
830 |
-
|
831 |
-
|
832 |
-
|
833 |
-
|
834 |
-
|
835 |
-
|
836 |
-
|
837 |
-
|
838 |
-
|
839 |
-
|
840 |
-
|
841 |
-
|
842 |
-
|
843 |
-
|
844 |
-
|
845 |
-
|
846 |
-
|
847 |
-
|
848 |
-
|
849 |
-
|
850 |
-
|
851 |
-
|
852 |
-
|
853 |
-
|
854 |
-
|
855 |
-
|
856 |
-
|
857 |
-
|
858 |
-
|
859 |
-
|
860 |
-
|
861 |
-
|
862 |
-
|
863 |
-
|
864 |
-
|
865 |
-
|
866 |
-
|
867 |
-
|
868 |
-
|
869 |
-
|
870 |
-
|
871 |
-
|
872 |
-
|
873 |
-
|
874 |
-
|
875 |
-
|
876 |
-
|
877 |
-
|
878 |
-
|
879 |
-
|
880 |
-
|
881 |
-
|
882 |
-
|
883 |
-
|
884 |
-
|
885 |
-
|
886 |
-
|
887 |
-
|
888 |
-
|
889 |
-
|
890 |
-
|
891 |
-
|
892 |
-
|
893 |
-
|
894 |
-
|
895 |
-
|
896 |
-
|
897 |
-
|
898 |
-
|
899 |
-
|
900 |
-
|
901 |
-
|
902 |
-
|
903 |
-
|
904 |
-
|
905 |
-
|
906 |
-
|
907 |
-
|
908 |
-
|
909 |
-
|
910 |
-
|
911 |
-
|
912 |
-
|
913 |
-
|
914 |
-
|
915 |
-
|
916 |
-
|
917 |
-
|
918 |
-
|
919 |
-
|
920 |
-
|
921 |
-
|
922 |
-
|
923 |
-
|
924 |
-
|
925 |
-
|
926 |
-
|
927 |
-
|
928 |
-
|
929 |
-
|
930 |
-
|
931 |
-
|
932 |
-
|
933 |
-
|
934 |
-
|
935 |
-
|
936 |
-
|
937 |
-
|
938 |
-
|
939 |
-
|
940 |
-
|
941 |
-
|
942 |
-
|
943 |
-
|
944 |
-
|
945 |
-
|
946 |
-
|
947 |
-
|
948 |
-
|
949 |
-
|
950 |
-
|
951 |
-
|
952 |
-
|
953 |
-
|
954 |
-
|
955 |
-
|
956 |
-
|
957 |
-
|
958 |
-
|
959 |
-
|
960 |
-
|
961 |
-
|
962 |
-
|
963 |
-
|
964 |
-
|
965 |
-
|
966 |
-
|
967 |
-
|
968 |
-
|
969 |
-
|
970 |
-
|
971 |
-
|
972 |
-
|
973 |
-
|
974 |
-
|
975 |
-
|
976 |
-
|
977 |
-
|
978 |
-
|
979 |
-
|
980 |
-
|
981 |
-
|
982 |
-
|
983 |
-
|
984 |
-
|
985 |
-
|
986 |
-
|
987 |
-
|
988 |
-
|
989 |
-
|
990 |
-
|
991 |
-
|
992 |
-
|
993 |
-
|
994 |
-
|
995 |
-
|
996 |
-
|
997 |
-
|
998 |
-
global $wpdb;
|
999 |
-
$args['orderby'] = "$wpdb->postmeta.meta_value+0 DESC, $wpdb->posts.post_date DESC";
|
1000 |
-
|
1001 |
-
return $args;
|
1002 |
-
}
|
1003 |
-
}
|
1004 |
-
endif;
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if ( ! class_exists( 'rtTPGShortCode' ) ):
|
4 |
+
|
5 |
+
class rtTPGShortCode {
|
6 |
+
|
7 |
+
private $scA = array();
|
8 |
+
private $l4toggle = false;
|
9 |
+
|
10 |
+
function __construct() {
|
11 |
+
add_shortcode( 'the-post-grid', array( $this, 'the_post_grid_short_code' ) );
|
12 |
+
add_action( 'pre_get_posts', array( $this, 'make_sticky_work' ) );
|
13 |
+
}
|
14 |
+
|
15 |
+
function make_sticky_work( $q ) {
|
16 |
+
if ( true === $q->get( 'wp_tpg_is_home' ) ) {
|
17 |
+
$q->is_home = true;
|
18 |
+
}
|
19 |
+
}
|
20 |
+
|
21 |
+
function register_sc_scripts() {
|
22 |
+
|
23 |
+
$caro = $isSinglePopUp = false;
|
24 |
+
$script = array();
|
25 |
+
$style = array();
|
26 |
+
array_push( $script, 'jquery' );
|
27 |
+
$ajaxurl = '';
|
28 |
+
if ( in_array( 'sitepress-multilingual-cms/sitepress.php', get_option( 'active_plugins' ) ) ) {
|
29 |
+
$ajaxurl .= admin_url( 'admin-ajax.php?lang=' . ICL_LANGUAGE_CODE );
|
30 |
+
} else {
|
31 |
+
$ajaxurl .= admin_url( 'admin-ajax.php' );
|
32 |
+
}
|
33 |
+
$variables = array(
|
34 |
+
'nonceID' => rtTPG()->nonceId(),
|
35 |
+
'nonce' => wp_create_nonce( rtTPG()->nonceText() ),
|
36 |
+
'ajaxurl' => $ajaxurl
|
37 |
+
);
|
38 |
+
foreach ( $this->scA as $sc ) {
|
39 |
+
if ( isset( $sc ) && is_array( $sc ) ) {
|
40 |
+
if ( $sc['isSinglePopUp'] ) {
|
41 |
+
$isSinglePopUp = true;
|
42 |
+
}
|
43 |
+
if ( $sc['isWooCom'] ) {
|
44 |
+
$variables['woocommerce_enable_ajax_add_to_cart'] = get_option( 'woocommerce_enable_ajax_add_to_cart' );
|
45 |
+
$variables['woocommerce_cart_redirect_after_add'] = get_option( 'woocommerce_cart_redirect_after_add' );
|
46 |
+
}
|
47 |
+
}
|
48 |
+
}
|
49 |
+
if ( count( $this->scA ) ) {
|
50 |
+
array_push( $script, 'jquery' );
|
51 |
+
array_push( $script, 'rt-image-load-js' );
|
52 |
+
array_push( $script, 'rt-isotope-js' );
|
53 |
+
array_push( $style, 'rt-fontawsome' );
|
54 |
+
array_push( $script, 'rt-actual-height-js' );
|
55 |
+
array_push( $script, 'rt-tpg' );
|
56 |
+
if ( is_rtl() ) {
|
57 |
+
array_push( $style, 'rt-tpg-rtl' );
|
58 |
+
}
|
59 |
+
wp_enqueue_style( $style );
|
60 |
+
wp_enqueue_script( $script );
|
61 |
+
wp_localize_script( 'rt-tpg', 'rttpg', $variables );
|
62 |
+
|
63 |
+
do_action( 'tpg_after_script', $isSinglePopUp );
|
64 |
+
|
65 |
+
}
|
66 |
+
|
67 |
+
if ( $isSinglePopUp && rtTPG()->hasPro() ) {
|
68 |
+
$html = null;
|
69 |
+
$html .= '<div class="md-modal rt-md-effect" id="rt-modal">
|
70 |
+
<div class="md-content">
|
71 |
+
<div class="rt-md-content-holder">
|
72 |
+
|
73 |
+
</div>
|
74 |
+
<div class="md-cls-btn">
|
75 |
+
<button class="md-close"><i class="fa fa-times" aria-hidden="true"></i></button>
|
76 |
+
</div>
|
77 |
+
</div>
|
78 |
+
</div>';
|
79 |
+
$html .= "<div class='md-overlay'></div>";
|
80 |
+
echo $html;
|
81 |
+
}
|
82 |
+
}
|
83 |
+
|
84 |
+
function the_post_grid_short_code( $atts, $content = null ) {
|
85 |
+
$rand = mt_rand();
|
86 |
+
|
87 |
+
$layoutID = "rt-tpg-container-" . $rand;
|
88 |
+
|
89 |
+
$html = null;
|
90 |
+
$arg = array();
|
91 |
+
$atts = shortcode_atts( array(
|
92 |
+
'id' => null
|
93 |
+
), $atts, 'the-post-grid' );
|
94 |
+
$scID = $atts['id'];
|
95 |
+
if ( $scID && ! is_null( get_post( $scID ) ) ) {
|
96 |
+
$scMeta = get_post_meta( $scID );
|
97 |
+
|
98 |
+
$layout = ( isset( $scMeta['layout'][0] ) ? $scMeta['layout'][0] : 'layout1' );
|
99 |
+
if ( ! in_array( $layout, array_keys( rtTPG()->rtTPGLayouts() ) ) ) {
|
100 |
+
$layout = 'layout1';
|
101 |
+
}
|
102 |
+
|
103 |
+
$isIsotope = preg_match( '/isotope/', $layout );
|
104 |
+
$isCarousel = preg_match( '/carousel/', $layout );
|
105 |
+
$isGrid = preg_match( '/layout/', $layout );
|
106 |
+
$isWooCom = preg_match( '/wc/', $layout );
|
107 |
+
$isEdd = preg_match( '/edd/', $layout );
|
108 |
+
$isOffset = preg_match( '/offset/', $layout );
|
109 |
+
|
110 |
+
$colStore = $dCol = ( isset( $scMeta['column'][0] ) ? absint( $scMeta['column'][0] ) : 3 );
|
111 |
+
$tCol = ( isset( $scMeta['tpg_tab_column'][0] ) ? absint( $scMeta['tpg_tab_column'][0] ) : 2 );
|
112 |
+
$mCol = ( isset( $scMeta['tpg_mobile_column'][0] ) ? absint( $scMeta['tpg_mobile_column'][0] ) : 1 );
|
113 |
+
if ( ! in_array( $dCol, array_keys( rtTPG()->scColumns() ) ) ) {
|
114 |
+
$dCol = 3;
|
115 |
+
}
|
116 |
+
if ( ! in_array( $tCol, array_keys( rtTPG()->scColumns() ) ) ) {
|
117 |
+
$tCol = 2;
|
118 |
+
}
|
119 |
+
if ( ! in_array( $dCol, array_keys( rtTPG()->scColumns() ) ) ) {
|
120 |
+
$mCol = 1;
|
121 |
+
}
|
122 |
+
|
123 |
+
if ( $isOffset ) {
|
124 |
+
$dCol = ( $dCol < 3 ? 2 : $dCol );
|
125 |
+
$tCol = ( $tCol < 3 ? 2 : $tCol );
|
126 |
+
$mCol = ( $mCol < 3 ? 1 : $mCol );
|
127 |
+
}
|
128 |
+
$arg = array();
|
129 |
+
$fImg = ( ! empty( $scMeta['feature_image'][0] ) ? true : false );
|
130 |
+
$fImgSize = ( isset( $scMeta['featured_image_size'][0] ) ? $scMeta['featured_image_size'][0] : "medium" );
|
131 |
+
$mediaSource = ( isset( $scMeta['media_source'][0] ) ? $scMeta['media_source'][0] : "feature_image" );
|
132 |
+
$arg['excerpt_type'] = ( isset( $scMeta['tgp_excerpt_type'][0] ) ? $scMeta['tgp_excerpt_type'][0] : 'character' );
|
133 |
+
$arg['title_limit_type'] = ( isset( $scMeta['tpg_title_limit_type'][0] ) ? $scMeta['tpg_title_limit_type'][0] : 'character' );
|
134 |
+
$arg['excerpt_limit'] = ( isset( $scMeta['excerpt_limit'][0] ) ? absint( $scMeta['excerpt_limit'][0] ) : 0 );
|
135 |
+
$arg['title_limit'] = ( isset( $scMeta['tpg_title_limit'][0] ) ? absint( $scMeta['tpg_title_limit'][0] ) : 0 );
|
136 |
+
$arg['excerpt_more_text'] = ( isset( $scMeta['tgp_excerpt_more_text'][0] ) ? $scMeta['tgp_excerpt_more_text'][0] : null );
|
137 |
+
$arg['read_more_text'] = ( ! empty( $scMeta['tgp_read_more_text'][0] ) ? $scMeta['tgp_read_more_text'][0] : __( 'Read More',
|
138 |
+
'the-post-grid' ) );
|
139 |
+
$arg['show_all_text'] = ( ! empty( $scMeta['tpg_show_all_text'][0] ) ? $scMeta['tpg_show_all_text'][0] : __( 'Show all',
|
140 |
+
'the-post-grid' ) );
|
141 |
+
$arg['tpg_title_position'] = isset( $scMeta['tpg_title_position'][0] ) && ! empty( $scMeta['tpg_title_position'][0] ) ? $scMeta['tpg_title_position'][0] : null;
|
142 |
+
$arg['btn_alignment_class'] = isset( $scMeta['tpg_read_more_button_alignment'][0] ) && ! empty( $scMeta['tpg_read_more_button_alignment'][0] ) ? $scMeta['tpg_read_more_button_alignment'][0] : '';
|
143 |
+
|
144 |
+
/* Argument create */
|
145 |
+
$args = array();
|
146 |
+
$postType = ( isset( $scMeta['tpg_post_type'][0] ) ? $scMeta['tpg_post_type'][0] : 'post' );
|
147 |
+
if ( $postType ) {
|
148 |
+
$args['post_type'] = $postType;
|
149 |
+
}
|
150 |
+
|
151 |
+
// Common filter
|
152 |
+
/* post__in */
|
153 |
+
$post__in = ( isset( $scMeta['post__in'][0] ) ? $scMeta['post__in'][0] : null );
|
154 |
+
if ( $post__in ) {
|
155 |
+
$post__in = explode( ',', $post__in );
|
156 |
+
$args['post__in'] = $post__in;
|
157 |
+
}
|
158 |
+
/* post__not_in */
|
159 |
+
$post__not_in = ( isset( $scMeta['post__not_in'][0] ) ? $scMeta['post__not_in'][0] : null );
|
160 |
+
if ( $post__not_in ) {
|
161 |
+
$post__not_in = explode( ',', $post__not_in );
|
162 |
+
$args['post__not_in'] = $post__not_in;
|
163 |
+
}
|
164 |
+
|
165 |
+
/* LIMIT */
|
166 |
+
$limit = ( ( empty( $scMeta['limit'][0] ) || $scMeta['limit'][0] === '-1' ) ? - 1 : absint( $scMeta['limit'][0] ) );
|
167 |
+
$args['posts_per_page'] = $limit;
|
168 |
+
$pagination = ! empty( $scMeta['pagination'][0] );
|
169 |
+
$posts_loading_type = ( ! empty( $scMeta['posts_loading_type'][0] ) ? $scMeta['posts_loading_type'][0] : "pagination" );
|
170 |
+
if ( $pagination ) {
|
171 |
+
$posts_per_page = ( isset( $scMeta['posts_per_page'][0] ) ? intval( $scMeta['posts_per_page'][0] ) : $limit );
|
172 |
+
$args['posts_per_page'] = $posts_per_page;
|
173 |
+
$args['paged'] = get_query_var( 'page' ) ? get_query_var( 'page' ) : ( get_query_var( 'paged' ) ? get_query_var( 'paged' ) : 1 );
|
174 |
+
}
|
175 |
+
|
176 |
+
// Advance Filter
|
177 |
+
$adv_filter = get_post_meta( $scID, 'post_filter' );
|
178 |
+
$taxFilter = get_post_meta( $scID, 'tgp_filter_taxonomy', true );
|
179 |
+
$taxHierarchical = get_post_meta( $scID, 'tgp_filter_taxonomy_hierarchical', true );
|
180 |
+
$taxFilterTerms = array();
|
181 |
+
$taxFilterOperator = "IN";
|
182 |
+
// Taxonomy
|
183 |
+
$taxQ = array();
|
184 |
+
if ( in_array( 'tpg_taxonomy', $adv_filter ) && isset( $scMeta['tpg_taxonomy'] ) ) {
|
185 |
+
|
186 |
+
if ( is_array( $scMeta['tpg_taxonomy'] ) && ! empty( $scMeta['tpg_taxonomy'] ) ) {
|
187 |
+
foreach ( $scMeta['tpg_taxonomy'] as $taxonomy ) {
|
188 |
+
$terms = ( isset( $scMeta[ 'term_' . $taxonomy ] ) ? $scMeta[ 'term_' . $taxonomy ] : array() );
|
189 |
+
if ( is_array( $terms ) && ! empty( $terms ) ) {
|
190 |
+
$operator = ( isset( $scMeta[ 'term_operator_' . $taxonomy ][0] ) ? $scMeta[ 'term_operator_' . $taxonomy ][0] : "IN" );
|
191 |
+
$taxQ[] = array(
|
192 |
+
'taxonomy' => $taxonomy,
|
193 |
+
'field' => 'term_id',
|
194 |
+
'terms' => $terms,
|
195 |
+
'operator' => $operator,
|
196 |
+
);
|
197 |
+
if ( $taxonomy == $taxFilter ) {
|
198 |
+
$taxFilterOperator = $operator;
|
199 |
+
}
|
200 |
+
}
|
201 |
+
if ( $taxonomy == $taxFilter ) {
|
202 |
+
$taxFilterTerms = $terms;
|
203 |
+
}
|
204 |
+
}
|
205 |
+
}
|
206 |
+
if ( count( $taxQ ) >= 2 ) {
|
207 |
+
$relation = ( isset( $scMeta['taxonomy_relation'][0] ) ? $scMeta['taxonomy_relation'][0] : "AND" );
|
208 |
+
$taxQ['relation'] = $relation;
|
209 |
+
}
|
210 |
+
}
|
211 |
+
|
212 |
+
if ( ! empty( $taxQ ) ) {
|
213 |
+
$args['tax_query'] = $taxQ;
|
214 |
+
}
|
215 |
+
|
216 |
+
|
217 |
+
// Order
|
218 |
+
if ( in_array( 'order', $adv_filter ) ) {
|
219 |
+
$order_by = ( isset( $scMeta['order_by'][0] ) ? $scMeta['order_by'][0] : null );
|
220 |
+
$order = ( isset( $scMeta['order'][0] ) ? $scMeta['order'][0] : null );
|
221 |
+
if ( $order ) {
|
222 |
+
$args['order'] = $order;
|
223 |
+
}
|
224 |
+
if ( $order_by ) {
|
225 |
+
$args['orderby'] = $order_by;
|
226 |
+
$meta_key = ! empty( $scMeta['tpg_meta_key'][0] ) ? trim( $scMeta['tpg_meta_key'][0] ) : null;
|
227 |
+
if ( in_array( $order_by, array_keys( rtTPG()->rtMetaKeyType() ) ) && $meta_key ) {
|
228 |
+
$args['orderby'] = $order_by;
|
229 |
+
$args['meta_key'] = $meta_key;
|
230 |
+
}
|
231 |
+
}
|
232 |
+
}
|
233 |
+
|
234 |
+
// Status
|
235 |
+
if ( in_array( 'tpg_post_status', $adv_filter ) ) {
|
236 |
+
$post_status = ( isset( $scMeta['tpg_post_status'] ) ? $scMeta['tpg_post_status'] : array() );
|
237 |
+
if ( ! empty( $post_status ) ) {
|
238 |
+
$args['post_status'] = $post_status;
|
239 |
+
} else {
|
240 |
+
$args['post_status'] = 'publish';
|
241 |
+
}
|
242 |
+
}
|
243 |
+
// Author
|
244 |
+
$author = ( isset( $scMeta['author'] ) ? $scMeta['author'] : array() );
|
245 |
+
$filterAuthors = array();
|
246 |
+
if ( in_array( 'author', $adv_filter ) && ! empty( $author ) ) {
|
247 |
+
$filterAuthors = $args['author__in'] = $author;
|
248 |
+
}
|
249 |
+
|
250 |
+
// Search
|
251 |
+
$s = ( isset( $scMeta['s'][0] ) ? $scMeta['s'][0] : array() );
|
252 |
+
if ( in_array( 's', $adv_filter ) && ! empty( $s ) ) {
|
253 |
+
$args['s'] = $s;
|
254 |
+
}
|
255 |
+
|
256 |
+
// Date query
|
257 |
+
if ( in_array( 'date_range', $adv_filter ) ) {
|
258 |
+
$startDate = ( ! empty( $scMeta['date_range_start'][0] ) ? $scMeta['date_range_start'][0] : null );
|
259 |
+
$endDate = ( ! empty( $scMeta['date_range_end'][0] ) ? $scMeta['date_range_end'][0] : null );
|
260 |
+
if ( $startDate && $endDate ) {
|
261 |
+
$args['date_query'] = array(
|
262 |
+
array(
|
263 |
+
'after' => $startDate,
|
264 |
+
'before' => $endDate,
|
265 |
+
'inclusive' => true,
|
266 |
+
),
|
267 |
+
);
|
268 |
+
}
|
269 |
+
}
|
270 |
+
|
271 |
+
$settings = get_option( rtTPG()->options['settings'] );
|
272 |
+
$oLayoutTag = ! empty( $settings['template_tag'] ) ? absint( $settings['template_tag'] ) : null;
|
273 |
+
$oLayoutAuthor = ! empty( $settings['template_author'] ) ? $settings['template_author'] : null;
|
274 |
+
$oLayoutCategory = ! empty( $settings['template_category'] ) ? $settings['template_category'] : null;
|
275 |
+
$oLayoutSearch = ! empty( $settings['template_search'] ) ? $settings['template_search'] : null;
|
276 |
+
$dataArchive = null;
|
277 |
+
if ( ( is_category() && $oLayoutCategory ) || ( is_search() && $oLayoutSearch ) || ( is_tag() && $oLayoutTag ) || ( is_author() && $oLayoutAuthor ) ) {
|
278 |
+
|
279 |
+
unset( $args['post_type'] );
|
280 |
+
unset( $args['tax_query'] );
|
281 |
+
unset( $args['author__in'] );
|
282 |
+
$obj = get_queried_object();
|
283 |
+
$aType = $aValue = null;
|
284 |
+
if ( $oLayoutTag && is_tag() ) {
|
285 |
+
if ( ! empty( $obj->slug ) ) {
|
286 |
+
$aValue = $args['tag'] = $obj->slug;
|
287 |
+
$aType = 'tag';
|
288 |
+
}
|
289 |
+
} else if ( $oLayoutCategory && is_category() ) {
|
290 |
+
if ( ! empty( $obj->slug ) ) {
|
291 |
+
$aValue = $args['category_name'] = $obj->slug;
|
292 |
+
}
|
293 |
+
$aType = 'category';
|
294 |
+
} else if ( $oLayoutAuthor && is_author() ) {
|
295 |
+
$aValue = $args['author'] = $obj->ID;
|
296 |
+
$aType = 'author';
|
297 |
+
} else if ( $oLayoutSearch && is_search() ) {
|
298 |
+
$aValue = $args['s'] = get_search_query();
|
299 |
+
$aType = 'search';
|
300 |
+
}
|
301 |
+
$dataArchive = " data-archive='{$aType}' data-archive-value='{$aValue}'";
|
302 |
+
$args['posts_per_archive_page'] = $args['posts_per_page'];
|
303 |
+
}
|
304 |
+
|
305 |
+
// Validation
|
306 |
+
$containerDataAttr = null;
|
307 |
+
$containerDataAttr .= " data-layout='{$layout}' data-desktop-col='{$dCol}' data-tab-col='{$tCol}' data-mobile-col='{$mCol}'";
|
308 |
+
|
309 |
+
$dCol = $dCol == 5 ? '24' : round( 12 / $dCol );
|
310 |
+
$tCol = $dCol == 5 ? '24' : round( 12 / $tCol );
|
311 |
+
$mCol = $dCol == 5 ? '24' : round( 12 / $mCol );
|
312 |
+
if ( $isCarousel ) {
|
313 |
+
$dCol = $tCol = $mCol = 12;
|
314 |
+
}
|
315 |
+
$arg['grid'] = "rt-col-md-{$dCol} rt-col-sm-{$tCol} rt-col-xs-{$mCol}";
|
316 |
+
if ( $layout == 'layout2' || $layout == 'layout3' ) {
|
317 |
+
$iCol = ( isset( $scMeta['tgp_layout2_image_column'][0] ) ? absint( $scMeta['tgp_layout2_image_column'][0] ) : 4 );
|
318 |
+
$iCol = $iCol > 12 ? 4 : $iCol;
|
319 |
+
$cCol = 12 - $iCol;
|
320 |
+
$arg['image_area'] = "rt-col-sm-{$iCol} rt-col-xs-12 ";
|
321 |
+
$arg['content_area'] = "rt-col-sm-{$cCol} rt-col-xs-12 ";
|
322 |
+
} else if ( $layout == 'layout4' ) {
|
323 |
+
$arg['image_area'] = "rt-col-md-6 rt-col-sm-12 rt-col-xs-12 ";
|
324 |
+
$arg['content_area'] = "rt-col-md-6 rt-col-sm-12 rt-col-xs-12 ";
|
325 |
+
}
|
326 |
+
$arg_class = [];
|
327 |
+
if ( ! $isIsotope && ! rtTPG()->hasPro() ) {
|
328 |
+
$arg_class[] = 'rt-equal-height';
|
329 |
+
}
|
330 |
+
$gridType = ! empty( $scMeta['grid_style'][0] ) ? $scMeta['grid_style'][0] : 'even';
|
331 |
+
if ( $isIsotope && ! rtTPG()->hasPro() ) {
|
332 |
+
$arg_class[] = "masonry-grid-item";
|
333 |
+
} else if ( ! $isCarousel && ! $isOffset ) {
|
334 |
+
$arg_class[] = $gridType . "-grid-item";
|
335 |
+
}
|
336 |
+
$arg_class[] = "rt-grid-item";
|
337 |
+
if ( $isOffset ) {
|
338 |
+
$arg_class[] = "rt-offset-item";
|
339 |
+
}
|
340 |
+
|
341 |
+
$masonryG = null;
|
342 |
+
if ( $gridType == "even" ) {
|
343 |
+
$masonryG = " tpg-even";
|
344 |
+
} else if ( $gridType == "masonry" && ! $isIsotope && ! $isCarousel ) {
|
345 |
+
$masonryG = " tpg-masonry";
|
346 |
+
}
|
347 |
+
$preLoader = $preLoaderHtml = null;
|
348 |
+
if ( $isIsotope ) {
|
349 |
+
$arg_class[] = 'isotope-item';
|
350 |
+
$preLoader = 'tpg-pre-loader';
|
351 |
+
}
|
352 |
+
if ( $isCarousel ) {
|
353 |
+
$arg_class[] = 'carousel-item';
|
354 |
+
$preLoader = 'tpg-pre-loader';
|
355 |
+
}
|
356 |
+
if ( $preLoader && rtTPG()->hasPro() ) {
|
357 |
+
$preLoaderHtml = '<div class="rt-loading-overlay"></div><div class="rt-loading rt-ball-clip-rotate"><div></div></div>';
|
358 |
+
}
|
359 |
+
|
360 |
+
$margin = ! empty( $scMeta['margin_option'][0] ) ? $scMeta['margin_option'][0] : 'default';
|
361 |
+
if ( $margin == 'no' ) {
|
362 |
+
$arg_class[] = 'no-margin';
|
363 |
+
}
|
364 |
+
if ( ! empty( $scMeta['tpg_image_type'][0] ) && $scMeta['tpg_image_type'][0] == 'circle' ) {
|
365 |
+
$arg_class[] = 'tpg-img-circle';
|
366 |
+
}
|
367 |
+
$arg['class'] = implode( " ", $arg_class );
|
368 |
+
$arg['anchorClass'] = $arg['link_target'] = null;
|
369 |
+
$link = ! empty( $scMeta['link_to_detail_page'][0] ) ? $scMeta['link_to_detail_page'][0] : 'yes';
|
370 |
+
if ( $link != 'yes' ) {
|
371 |
+
$arg['anchorClass'] = ' disabled';
|
372 |
+
}
|
373 |
+
$isSinglePopUp = false;
|
374 |
+
$linkType = ! empty( $scMeta['detail_page_link_type'][0] ) ? $scMeta['detail_page_link_type'][0] : 'popup';
|
375 |
+
if ( $link == 'yes' ) {
|
376 |
+
if ( $linkType == 'popup' && rtTPG()->hasPro() ) {
|
377 |
+
$popupType = ! empty( $scMeta['popup_type'][0] ) ? $scMeta['popup_type'][0] : 'single';
|
378 |
+
if ( $popupType == 'single' ) {
|
379 |
+
$arg['anchorClass'] .= ' tpg-single-popup';
|
380 |
+
$isSinglePopUp = true;
|
381 |
+
} else {
|
382 |
+
$arg['anchorClass'] .= ' tpg-multi-popup';
|
383 |
+
}
|
384 |
+
} else {
|
385 |
+
$arg['link_target'] = ! empty( $scMeta['link_target'][0] ) ? " target='{$scMeta['link_target'][0]}'" : null;
|
386 |
+
}
|
387 |
+
}
|
388 |
+
|
389 |
+
$parentClass = ( ! empty( $scMeta['parent_class'][0] ) ? trim( $scMeta['parent_class'][0] ) : null );
|
390 |
+
$defaultImgId = ( ! empty( $scMeta['default_preview_image'][0] ) ? absint( $scMeta['default_preview_image'][0] ) : null );
|
391 |
+
$customImgSize = ( ! empty( $scMeta['custom_image_size'] ) ? $scMeta['custom_image_size'] : array() );
|
392 |
+
|
393 |
+
$arg['scID'] = $scID;
|
394 |
+
$arg['items'] = isset( $scMeta['item_fields'] ) ? ( $scMeta['item_fields'] ? $scMeta['item_fields'] : array() ) : array();
|
395 |
+
if ( in_array( 'cf', $arg['items'] ) ) {
|
396 |
+
$arg['cf_group'] = array();
|
397 |
+
$arg['cf_group'] = get_post_meta( $scID, 'cf_group' );
|
398 |
+
$arg['format'] = array(
|
399 |
+
'hide_empty' => get_post_meta( $scID, 'cf_hide_empty_value', true ),
|
400 |
+
'show_value' => get_post_meta( $scID, 'cf_show_only_value', true ),
|
401 |
+
'hide_group_title' => get_post_meta( $scID, 'cf_hide_group_title', true )
|
402 |
+
);
|
403 |
+
}
|
404 |
+
|
405 |
+
// Set readmore false if excerpt type = full content
|
406 |
+
if ( isset( $arg['excerpt_type'] ) && $arg['excerpt_type'] === 'full' && ( $key = array_search( 'read_more', $arg['items'] ) ) !== false ) {
|
407 |
+
unset( $arg['items'][ $key ] );
|
408 |
+
}
|
409 |
+
|
410 |
+
if ( ! empty( $scMeta['ignore_sticky_posts'][0] ) ) {
|
411 |
+
$args['ignore_sticky_posts'] = true;
|
412 |
+
} else {
|
413 |
+
$args['wp_tpg_is_home'] = true;
|
414 |
+
}
|
415 |
+
|
416 |
+
$filters = ! empty( $scMeta['tgp_filter'] ) ? $scMeta['tgp_filter'] : array();
|
417 |
+
$action_term = ! empty( $scMeta['tgp_default_filter'][0] ) ? absint( $scMeta['tgp_default_filter'][0] ) : 0;
|
418 |
+
$hide_all_button = ! empty( $scMeta['tpg_hide_all_button'][0] ) ? true : false;
|
419 |
+
if ( $taxHierarchical ) {
|
420 |
+
$terms = rtTPG()->rt_get_all_term_by_taxonomy( $taxFilter, true, 0 );
|
421 |
+
} else {
|
422 |
+
$terms = rtTPG()->rt_get_all_term_by_taxonomy( $taxFilter, true );
|
423 |
+
}
|
424 |
+
if ( $hide_all_button && ! $action_term ) {
|
425 |
+
if ( ! empty( $terms ) ) {
|
426 |
+
$allKeys = array_keys( $terms );
|
427 |
+
$action_term = $allKeys[0];
|
428 |
+
}
|
429 |
+
}
|
430 |
+
if ( in_array( '_taxonomy_filter', $filters ) && $taxFilter && $action_term ) {
|
431 |
+
$args['tax_query'] = array(
|
432 |
+
array(
|
433 |
+
'taxonomy' => $taxFilter,
|
434 |
+
'field' => 'term_id',
|
435 |
+
'terms' => array( $action_term ),
|
436 |
+
)
|
437 |
+
);
|
438 |
+
}
|
439 |
+
|
440 |
+
if ( $limit != - 1 && $pagination ) {
|
441 |
+
$tempArgs = $args;
|
442 |
+
$tempArgs['posts_per_page'] = $limit;
|
443 |
+
$tempArgs['paged'] = 1;
|
444 |
+
$tempArgs['fields'] = 'ids';
|
445 |
+
$tempQ = new WP_Query( $tempArgs );
|
446 |
+
if ( ! empty( $tempQ->posts ) ) {
|
447 |
+
$args['post__in'] = $tempQ->posts;
|
448 |
+
}
|
449 |
+
}
|
450 |
+
|
451 |
+
$arg['title_tag'] = (!empty($scMeta['title_tag'][0]) && in_array($scMeta['title_tag'][0], array_keys(rtTPG()->getTitleTags()))) ? esc_attr($scMeta['title_tag'][0]) : 'h3';
|
452 |
+
|
453 |
+
$gridQuery = new WP_Query( apply_filters( 'tpg_sc_query_args', $args, $scMeta ) );
|
454 |
+
|
455 |
+
// Start layout
|
456 |
+
$html .= rtTPG()->layoutStyle( $layoutID, $scMeta, $layout, $scID );
|
457 |
+
$containerDataAttr .= " data-sc-id='{$scID}'";
|
458 |
+
$html .= "<div class='rt-container-fluid rt-tpg-container {$parentClass}' id='{$layoutID}' {$dataArchive} {$containerDataAttr}>";
|
459 |
+
if ( ! empty( $filters ) && ( $isGrid || $isOffset || $isWooCom || $isEdd ) ) {
|
460 |
+
$html .= "<div class='rt-layout-filter-container rt-clear'><div class='rt-filter-wrap'>";
|
461 |
+
$selectedSubTermsForButton = null;
|
462 |
+
$allText = apply_filters( 'tpg_filter_all_text', __( "All", "the-post-grid" ), $scMeta );
|
463 |
+
if ( in_array( '_taxonomy_filter', $filters ) && $taxFilter ) {
|
464 |
+
$filterType = ( ! empty( $scMeta['tgp_filter_type'][0] ) ? $scMeta['tgp_filter_type'][0] : null );
|
465 |
+
$post_count = ( ! empty( $scMeta['tpg_post_count'][0] ) ? $scMeta['tpg_post_count'][0] : null );
|
466 |
+
$postCountClass = ( $post_count ? " has-post-count" : null );
|
467 |
+
$allSelect = " selected";
|
468 |
+
$isTermSelected = false;
|
469 |
+
if ( $action_term && $taxFilter ) {
|
470 |
+
$isTermSelected = true;
|
471 |
+
$allSelect = null;
|
472 |
+
}
|
473 |
+
if ( ! $filterType || $filterType == 'dropdown' ) {
|
474 |
+
$html .= "<div class='rt-filter-item-wrap rt-tax-filter rt-filter-dropdown-wrap parent-dropdown-wrap{$postCountClass}' data-taxonomy='{$taxFilter}'>";
|
475 |
+
$termDefaultText = $allText;
|
476 |
+
$dataTerm = 'all';
|
477 |
+
$htmlButton = "";
|
478 |
+
$selectedSubTerms = null;
|
479 |
+
$pCount = 0;
|
480 |
+
if ( ! empty( $terms ) ) {
|
481 |
+
$i = 0;
|
482 |
+
foreach ( $terms as $id => $term ) {
|
483 |
+
$pCount = $pCount + $term['count'];
|
484 |
+
$sT = null;
|
485 |
+
if ( $taxHierarchical ) {
|
486 |
+
$subTerms = rtTPG()->rt_get_all_term_by_taxonomy( $taxFilter, true, $id );
|
487 |
+
if ( ! empty( $subTerms ) ) {
|
488 |
+
$count = 0;
|
489 |
+
$item = $allCount = null;
|
490 |
+
foreach ( $subTerms as $stId => $t ) {
|
491 |
+
$count = $count + absint( $t['count'] );
|
492 |
+
$sTPostCount = ( $post_count ? " (<span class='rt-post-count'>{$t['count']}</span>)" : null );
|
493 |
+
$item .= "<span class='term-dropdown-item rt-filter-dropdown-item' data-term='{$stId}'><span class='rt-text'>{$t['name']}{$sTPostCount}</span></span>";
|
494 |
+
}
|
495 |
+
if ( $post_count ) {
|
496 |
+
$allCount = " (<span class='rt-post-count'>{$count}</span>)";
|
497 |
+
}
|
498 |
+
$sT .= "<div class='rt-filter-item-wrap rt-tax-filter rt-filter-dropdown-wrap sub-dropdown-wrap{$postCountClass}'>";
|
499 |
+
$sT .= "<span class='term-default rt-filter-dropdown-default' data-term='{$id}'>
|
500 |
+
<span class='rt-text'>" . $allText . "{$allCount}</span>
|
501 |
+
<i class='fa fa-angle-down rt-arrow-angle' aria-hidden='true'></i>
|
502 |
+
</span>";
|
503 |
+
$sT .= '<span class="term-dropdown rt-filter-dropdown">';
|
504 |
+
$sT .= $item;
|
505 |
+
$sT .= '</span>';
|
506 |
+
$sT .= "</div>";
|
507 |
+
}
|
508 |
+
if ( $action_term === $id ) {
|
509 |
+
$selectedSubTerms = $sT;
|
510 |
+
}
|
511 |
+
}
|
512 |
+
$postCount = ( $post_count ? " (<span class='rt-post-count'>{$term['count']}</span>)" : null );
|
513 |
+
if ( $action_term && $action_term == $id ) {
|
514 |
+
$termDefaultText = $term['name'] . $postCount;
|
515 |
+
$dataTerm = $id;
|
516 |
+
}
|
517 |
+
if ( is_array( $taxFilterTerms ) && ! empty( $taxFilterTerms ) ) {
|
518 |
+
if ( $taxFilterOperator == "NOT IN" ) {
|
519 |
+
if ( ! in_array( $id, $taxFilterTerms ) && $action_term != $id ) {
|
520 |
+
$htmlButton .= "<span class='term-dropdown-item rt-filter-dropdown-item' data-term='{$id}'><span class='rt-text'>{$term['name']}{$postCount}</span>{$sT}</span>";
|
521 |
+
}
|
522 |
+
} else {
|
523 |
+
if ( in_array( $id, $taxFilterTerms ) && $action_term != $id ) {
|
524 |
+
$htmlButton .= "<span class='term-dropdown-item rt-filter-dropdown-item' data-term='{$id}'><span class='rt-text'>{$term['name']}{$postCount}</span>{$sT}</span>";
|
525 |
+
}
|
526 |
+
}
|
527 |
+
} else {
|
528 |
+
$htmlButton .= "<span class='term-dropdown-item rt-filter-dropdown-item' data-term='{$id}'><span class='rt-text'>{$term['name']}{$postCount}</span>{$sT}</span>";
|
529 |
+
}
|
530 |
+
$i ++;
|
531 |
+
}
|
532 |
+
}
|
533 |
+
$pAllCount = null;
|
534 |
+
if ( $post_count ) {
|
535 |
+
$pAllCount = " (<span class='rt-post-count'>{$pCount}</span>)";
|
536 |
+
if ( ! $action_term ) {
|
537 |
+
$termDefaultText = $termDefaultText . $pAllCount;
|
538 |
+
}
|
539 |
+
}
|
540 |
+
if ( ! $hide_all_button ) {
|
541 |
+
$htmlButton = "<span class='term-dropdown-item rt-filter-dropdown-item' data-term='all'><span class='rt-text'>" . $allText . "{$pAllCount}</span></span>" . $htmlButton;
|
542 |
+
}
|
543 |
+
$htmlButton = sprintf( '<span class="term-dropdown rt-filter-dropdown">%s</span>', $htmlButton );
|
544 |
+
|
545 |
+
$showAllhtml = '<span class="term-default rt-filter-dropdown-default" data-term="' . $dataTerm . '">
|
546 |
+
<span class="rt-text">' . $termDefaultText . '</span>
|
547 |
+
<i class="fa fa-angle-down rt-arrow-angle" aria-hidden="true"></i>
|
548 |
+
</span>';
|
549 |
+
|
550 |
+
$html .= $showAllhtml . $htmlButton;
|
551 |
+
$html .= '</div>' . $selectedSubTerms;
|
552 |
+
} else {
|
553 |
+
$termDefaultText = $allText;
|
554 |
+
$bCount = 0;
|
555 |
+
$bItems = null;
|
556 |
+
if ( ! empty( $terms ) ) {
|
557 |
+
foreach ( $terms as $id => $term ) {
|
558 |
+
$bCount = $bCount + absint( $term['count'] );
|
559 |
+
$sT = null;
|
560 |
+
if ( $taxHierarchical ) {
|
561 |
+
$subTerms = rtTPG()->rt_get_all_term_by_taxonomy( $taxFilter, true, $id );
|
562 |
+
if ( ! empty( $subTerms ) ) {
|
563 |
+
$sT .= "<div class='rt-filter-sub-tax sub-button-group'>";
|
564 |
+
foreach ( $subTerms as $stId => $t ) {
|
565 |
+
$sTPostCount = ( $post_count ? " (<span class='rt-post-count'>{$t['count']}</span>)" : null );
|
566 |
+
$sT .= "<span class='rt-filter-button-item' data-term='{$stId}'>{$t['name']}{$sTPostCount}</span>";
|
567 |
+
}
|
568 |
+
$sT .= "</div>";
|
569 |
+
if ( $action_term === $id ) {
|
570 |
+
$selectedSubTermsForButton = $sT;
|
571 |
+
}
|
572 |
+
}
|
573 |
+
}
|
574 |
+
$postCount = ( $post_count ? " (<span class='rt-post-count'>{$term['count']}</span>)" : null );
|
575 |
+
$termSelected = null;
|
576 |
+
if ( $isTermSelected && $id == $action_term ) {
|
577 |
+
$termSelected = " selected";
|
578 |
+
}
|
579 |
+
if ( is_array( $taxFilterTerms ) && ! empty( $taxFilterTerms ) ) {
|
580 |
+
if ( $taxFilterOperator == "NOT IN" ) {
|
581 |
+
if ( ! in_array( $id, $taxFilterTerms ) ) {
|
582 |
+
$bItems .= "<span class='term-button-item rt-filter-button-item {$termSelected}' data-term='{$id}'>{$term['name']}{$postCount}{$sT}</span>";
|
583 |
+
}
|
584 |
+
} else {
|
585 |
+
if ( in_array( $id, $taxFilterTerms ) ) {
|
586 |
+
$bItems .= "<span class='term-button-item rt-filter-button-item {$termSelected}' data-term='{$id}'>{$term['name']}{$postCount}{$sT}</span>";
|
587 |
+
}
|
588 |
+
}
|
589 |
+
|
590 |
+
} else {
|
591 |
+
$bItems .= "<span class='term-button-item rt-filter-button-item {$termSelected}' data-term='{$id}'>{$term['name']}{$postCount}{$sT}</span>";
|
592 |
+
}
|
593 |
+
}
|
594 |
+
}
|
595 |
+
$html .= "<div class='rt-filter-item-wrap rt-tax-filter rt-filter-button-wrap{$postCountClass}' data-taxonomy='{$taxFilter}'>";
|
596 |
+
if ( ! $hide_all_button ) {
|
597 |
+
$pCountH = ( $post_count ? " (<span class='rt-post-count'>{$bCount}</span>)" : null );
|
598 |
+
$html .= "<span class='term-button-item rt-filter-button-item {$allSelect}' data-term='all'>" . $allText . "{$pCountH}</span>";
|
599 |
+
}
|
600 |
+
$html .= $bItems;
|
601 |
+
$html .= "</div>";
|
602 |
+
}
|
603 |
+
}
|
604 |
+
|
605 |
+
// Author filter
|
606 |
+
if ( in_array( '_author_filter', $filters ) ) {
|
607 |
+
$filterType = ( ! empty( $scMeta['tgp_filter_type'][0] ) ? $scMeta['tgp_filter_type'][0] : null );
|
608 |
+
$post_count = ( ! empty( $scMeta['tpg_post_count'][0] ) ? $scMeta['tpg_post_count'][0] : null );
|
609 |
+
$users = get_users( apply_filters( 'tpg_author_arg', array() ) );
|
610 |
+
|
611 |
+
$allSelect = " selected";
|
612 |
+
$isTermSelected = false;
|
613 |
+
if ( $action_term && $taxFilter ) {
|
614 |
+
$isTermSelected = true;
|
615 |
+
$allSelect = null;
|
616 |
+
}
|
617 |
+
if ( ! $filterType || $filterType == 'dropdown' ) {
|
618 |
+
$html .= "<div class='rt-filter-item-wrap rt-author-filter rt-filter-dropdown-wrap parent-dropdown-wrap{$postCountClass}'>";
|
619 |
+
$termDefaultText = $allText;
|
620 |
+
$dataAuthor = 'all';
|
621 |
+
$htmlButton = "";
|
622 |
+
$htmlButton .= '<span class="author-dropdown rt-filter-dropdown">';
|
623 |
+
if ( ! empty( $users ) ) {
|
624 |
+
foreach ( $users as $user ) {
|
625 |
+
if ( is_array( $filterAuthors ) && ! empty( $filterAuthors ) ) {
|
626 |
+
if ( in_array( $user->ID, $filterAuthors ) ) {
|
627 |
+
if ( $action_term == $user->ID ) {
|
628 |
+
$termDefaultText = $user->display_name;
|
629 |
+
$dataTerm = $user->ID;
|
630 |
+
} else {
|
631 |
+
$htmlButton .= "<span class='term-dropdown-item rt-filter-dropdown-item' data-term='{$user->ID}'>{$user->display_name}</span>";
|
632 |
+
}
|
633 |
+
}
|
634 |
+
} else {
|
635 |
+
if ( $action_term == $user->ID ) {
|
636 |
+
$termDefaultText = $user->display_name;
|
637 |
+
$dataTerm = $user->ID;
|
638 |
+
} else {
|
639 |
+
$htmlButton .= "<span class='term-dropdown-item rt-filter-dropdown-item' data-term='{$user->ID}'>{$user->display_name}</span>";
|
640 |
+
}
|
641 |
+
}
|
642 |
+
}
|
643 |
+
}
|
644 |
+
|
645 |
+
if ( $isTermSelected ) {
|
646 |
+
$htmlButton .= "<span class='term-dropdown-item rt-filter-dropdown-item' data-term='all'>" . $allText . "{$pAllCount}</span>";
|
647 |
+
}
|
648 |
+
$htmlButton .= '</span>';
|
649 |
+
|
650 |
+
$showAllhtml = '<span class="term-default rt-filter-dropdown-default" data-term="' . $dataAuthor . '">
|
651 |
+
<span class="rt-text">' . $termDefaultText . '</span>
|
652 |
+
<i class="fa fa-angle-down rt-arrow-angle" aria-hidden="true"></i>
|
653 |
+
</span>';
|
654 |
+
|
655 |
+
$html .= $showAllhtml . $htmlButton;
|
656 |
+
$html .= '</div>';
|
657 |
+
} else {
|
658 |
+
$bCount = 0;
|
659 |
+
$bItems = null;
|
660 |
+
if ( ! empty( $users ) ) {
|
661 |
+
foreach ( $users as $user ) {
|
662 |
+
if ( is_array( $filterAuthors ) && ! empty( $filterAuthors ) ) {
|
663 |
+
if ( in_array( $user->ID, $filterAuthors ) ) {
|
664 |
+
$bItems .= "<span class='author-button-item rt-filter-button-item data-author='{$user->ID}'>{$user->display_name}</span>";
|
665 |
+
}
|
666 |
+
} else {
|
667 |
+
$bItems .= "<span class='author-button-item rt-filter-button-item data-author='{$user->ID}'>{$user->display_name}</span>";
|
668 |
+
}
|
669 |
+
}
|
670 |
+
}
|
671 |
+
$html .= "<div class='rt-filter-item-wrap rt-author-filter rt-filter-button-wrap{$postCountClass}' data-taxonomy='{$taxFilter}'>";
|
672 |
+
if ( ! $hide_all_button ) {
|
673 |
+
$pCountH = ( $post_count ? " (<span class='rt-post-count'>{$bCount}</span>)" : null );
|
674 |
+
$html .= "<span class='author-button-item rt-filter-button-item {$allSelect}' data-author='all'>" . $allText . "{$pCountH}</span>";
|
675 |
+
}
|
676 |
+
$html .= $bItems;
|
677 |
+
$html .= "</div>";
|
678 |
+
}
|
679 |
+
}
|
680 |
+
|
681 |
+
if ( in_array( '_sort_order', $filters ) ) {
|
682 |
+
$action_order = ( ! empty( $args['order'] ) ? strtoupper( trim( $args['order'] ) ) : "DESC" );
|
683 |
+
$html .= '<div class="rt-filter-item-wrap rt-sort-order-action">';
|
684 |
+
$html .= "<span class='rt-sort-order-action-arrow' data-sort-order='{$action_order}'> <span></span></span>";
|
685 |
+
$html .= '</div>';
|
686 |
+
}
|
687 |
+
|
688 |
+
if ( in_array( '_order_by', $filters ) ) {
|
689 |
+
$wooFeature = ( $postType == "product" ? true : false );
|
690 |
+
$orders = rtTPG()->rtPostOrderBy( $wooFeature );
|
691 |
+
$action_orderby = ( ! empty( $args['orderby'] ) ? trim( $args['orderby'] ) : "none" );
|
692 |
+
if ( $action_orderby == 'none' ) {
|
693 |
+
$action_orderby_label = __( "Sort By None", "the-post-grid" );
|
694 |
+
} elseif ( in_array( $action_orderby, array_keys( rtTPG()->rtMetaKeyType() ) ) ) {
|
695 |
+
$action_orderby_label = __( "Meta value", "the-post-grid" );
|
696 |
+
} else {
|
697 |
+
$action_orderby_label = $orders[ $action_orderby ];
|
698 |
+
}
|
699 |
+
if ( $action_orderby !== 'none' ) {
|
700 |
+
$orders['none'] = __( "Sort By None", "the-post-grid" );
|
701 |
+
}
|
702 |
+
$html .= '<div class="rt-filter-item-wrap rt-order-by-action rt-filter-dropdown-wrap">';
|
703 |
+
$html .= "<span class='order-by-default rt-filter-dropdown-default' data-order-by='{$action_orderby}'>
|
704 |
+
<span class='rt-text-order-by'>{$action_orderby_label}</span>
|
705 |
+
<i class='fa fa-angle-down rt-arrow-angle' aria-hidden='true'></i>
|
706 |
+
</span>";
|
707 |
+
$html .= '<span class="order-by-dropdown rt-filter-dropdown">';
|
708 |
+
|
709 |
+
foreach ( $orders as $orderKey => $order ) {
|
710 |
+
$html .= '<span class="order-by-dropdown-item rt-filter-dropdown-item" data-order-by="' . $orderKey . '">' . $order . '</span>';
|
711 |
+
}
|
712 |
+
$html .= '</span>';
|
713 |
+
$html .= '</div>';
|
714 |
+
}
|
715 |
+
|
716 |
+
if ( in_array( '_search', $filters ) ) {
|
717 |
+
$html .= '<div class="rt-filter-item-wrap rt-search-filter-wrap">';
|
718 |
+
$html .= sprintf( '<input type="text" class="rt-search-input" placeholder="%s">', esc_html__( "Search...", 'the-post-grid' ) );
|
719 |
+
$html .= "<span class='rt-action'>🔍</span>";
|
720 |
+
$html .= "<span class='rt-loading'></span>";
|
721 |
+
$html .= '</div>';
|
722 |
+
}
|
723 |
+
$html .= "</div>$selectedSubTermsForButton</div>";
|
724 |
+
}
|
725 |
+
|
726 |
+
$html .= "<div data-title='" . __( "Loading ...",
|
727 |
+
'the-post-grid' ) . "' class='rt-row rt-content-loader {$layout}{$masonryG} {$preLoader}'>";
|
728 |
+
|
729 |
+
if ( $gridQuery->have_posts() ) {
|
730 |
+
|
731 |
+
if ( $isCarousel ) {
|
732 |
+
$cOpt = ! empty( $scMeta['carousel_property'] ) ? $scMeta['carousel_property'] : array();
|
733 |
+
$slider_js_options = apply_filters( 'rttpg_slider_js_options', array(
|
734 |
+
"speed" => ! empty( $scMeta['tpg_carousel_speed'][0] ) ? absint( $scMeta['tpg_carousel_speed'][0] ) : 250,
|
735 |
+
"autoPlayTimeOut" => ! empty( $scMeta['tpg_carousel_autoplay_timeout'][0] ) ? absint( $scMeta['tpg_carousel_autoplay_timeout'][0] ) : 5000,
|
736 |
+
"autoPlay" => in_array( 'auto_play', $cOpt ),
|
737 |
+
"stopOnHover" => in_array( 'stop_hover', $cOpt ),
|
738 |
+
"nav" => in_array( 'nav_button', $cOpt ),
|
739 |
+
"dots" => in_array( 'pagination', $cOpt ),
|
740 |
+
"loop" => in_array( 'loop', $cOpt ),
|
741 |
+
"lazyLoad" => in_array( 'lazyLoad', $cOpt ),
|
742 |
+
"autoHeight" => in_array( 'autoHeight', $cOpt ),
|
743 |
+
"rtl" => in_array( 'rtl', $cOpt )
|
744 |
+
), $scMeta );
|
745 |
+
$html .= sprintf( '<div class="rt-carousel-holder" data-rtowl-options="%s">',
|
746 |
+
htmlspecialchars( wp_json_encode( $slider_js_options ) ) );
|
747 |
+
}
|
748 |
+
$isotope_filter = null;
|
749 |
+
if ( $isIsotope ) {
|
750 |
+
$isotope_filter = isset( $scMeta['isotope_filter'][0] ) ? $scMeta['isotope_filter'][0] : null;
|
751 |
+
$isotope_dropdown_filter = isset( $scMeta['isotope_filter_dropdown'][0] ) ? $scMeta['isotope_filter_dropdown'][0] : null;
|
752 |
+
$selectedTerms = array();
|
753 |
+
if ( isset( $scMeta['post_filter'] ) && in_array( 'tpg_taxonomy',
|
754 |
+
$scMeta['post_filter'] ) && isset( $scMeta['tpg_taxonomy'] ) && in_array( $isotope_filter,
|
755 |
+
$scMeta['tpg_taxonomy'] )
|
756 |
+
) {
|
757 |
+
$selectedTerms = ( isset( $scMeta[ 'term_' . $isotope_filter ] ) ? $scMeta[ 'term_' . $isotope_filter ] : array() );
|
758 |
+
}
|
759 |
+
$termArgs = [
|
760 |
+
'taxonomy' => $isotope_filter,
|
761 |
+
'orderby' => 'meta_value_num',
|
762 |
+
'order' => 'ASC',
|
763 |
+
'hide_empty' => false,
|
764 |
+
'include' => $selectedTerms
|
765 |
+
];
|
766 |
+
if ( rtTPG()->hasPro() ) {
|
767 |
+
$termArgs['meta_key'] = '_rt_order';
|
768 |
+
}
|
769 |
+
$terms = get_terms( $termArgs );
|
770 |
+
|
771 |
+
$html .= '<div class="tpg-iso-filter">';
|
772 |
+
$htmlButton = $drop = null;
|
773 |
+
$fSelectTrigger = false;
|
774 |
+
|
775 |
+
if ( ! empty( $terms ) && ! is_wp_error( $terms ) ) {
|
776 |
+
foreach ( $terms as $term ) {
|
777 |
+
$tItem = ! empty( $scMeta['isotope_default_filter'][0] ) ? $scMeta['isotope_default_filter'][0] : null;
|
778 |
+
$fSelected = null;
|
779 |
+
if ( $tItem == $term->term_id ) {
|
780 |
+
$fSelected = 'selected';
|
781 |
+
$fSelectTrigger = true;
|
782 |
+
}
|
783 |
+
$htmlButton .= sprintf( '<button class="rt-iso-btn-%s%s" data-filter=".iso_%d">%s</button>',
|
784 |
+
esc_attr( $term->slug ),
|
785 |
+
$fSelected ? " " . $fSelected : '',
|
786 |
+
$term->term_id,
|
787 |
+
$term->name
|
788 |
+
);
|
789 |
+
$drop .= "<option value='.iso_{$term->term_id}' {$fSelected}>{$term->name}</option>";
|
790 |
+
}
|
791 |
+
}
|
792 |
+
if ( empty( $scMeta['isotope_filter_show_all'][0] ) ) {
|
793 |
+
$fSelect = ( $fSelectTrigger ? null : 'class="selected"' );
|
794 |
+
$htmlButton = "<button class='rt-iso-btn-all selected' data-filter='*'>" . $arg['show_all_text'] . "</button>" . $htmlButton;
|
795 |
+
$drop = "<option value='*' {$fSelect}>{$arg['show_all_text']}</option>" . $drop;
|
796 |
+
}
|
797 |
+
$filter_count = ! empty( $scMeta['isotope_filter_count'][0] ) ? true : false;
|
798 |
+
$filter_url = ! empty( $scMeta['isotope_filter_url'][0] ) ? true : false;
|
799 |
+
$htmlButton = "<div id='iso-button-{$rand}' class='rt-tpg-isotope-buttons button-group filter-button-group option-set' data-url='{$filter_url}' data-count='{$filter_count}'>{$htmlButton}</div>";
|
800 |
+
|
801 |
+
if ( $isotope_dropdown_filter ) {
|
802 |
+
$html .= "<select class='isotope-dropdown-filter'>{$drop}</select>";
|
803 |
+
} else {
|
804 |
+
$html .= $htmlButton;
|
805 |
+
}
|
806 |
+
if ( ! empty( $scMeta['isotope_search_filter'][0] ) ) {
|
807 |
+
$html .= "<div class='iso-search'><input type='text' class='iso-search-input' placeholder='" . __( 'Search',
|
808 |
+
'the-post-grid' ) . "' /></div>";
|
809 |
+
}
|
810 |
+
$html .= '</div>';
|
811 |
+
|
812 |
+
$html .= "<div class='rt-tpg-isotope' id='iso-tpg-{$rand}'>";
|
813 |
+
}
|
814 |
+
|
815 |
+
$l = $offLoop = 0;
|
816 |
+
$offsetBigHtml = $offsetSmallHtml = null;
|
817 |
+
|
818 |
+
while ( $gridQuery->have_posts() ) : $gridQuery->the_post();
|
819 |
+
if ( $colStore == $l ) {
|
820 |
+
if ( $this->l4toggle ) {
|
821 |
+
$this->l4toggle = false;
|
822 |
+
} else {
|
823 |
+
$this->l4toggle = true;
|
824 |
+
}
|
825 |
+
$l = 0;
|
826 |
+
}
|
827 |
+
$pID = get_the_ID();
|
828 |
+
$arg['pID'] = $pID;
|
829 |
+
$arg['title'] = rtTPG()->get_the_title( $pID, $arg );
|
830 |
+
$arg['pLink'] = get_permalink();
|
831 |
+
$arg['toggle'] = $this->l4toggle;
|
832 |
+
$arg['layoutID'] = $layoutID;
|
833 |
+
$arg['author'] = apply_filters( 'rttpg_author_link', sprintf( '<a href="%s">%s</a>', get_author_posts_url( get_the_author_meta( 'ID' ) ), get_the_author() ) );
|
834 |
+
$cc = wp_count_comments( $pID );
|
835 |
+
$arg['date'] = get_the_date();
|
836 |
+
$arg['excerpt'] = rtTPG()->get_the_excerpt( $pID, $arg );
|
837 |
+
$arg['categories'] = get_the_term_list( $pID, 'category', null, '<span class="rt-separator">,</span>' );
|
838 |
+
$arg['tags'] = get_the_term_list( $pID, 'post_tag', null, '<span class="rt-separator">,</span>' );
|
839 |
+
if ( $isIsotope ) {
|
840 |
+
$termAs = wp_get_post_terms( $pID, $isotope_filter, array( "fields" => "all" ) );
|
841 |
+
$isoFilter = [];
|
842 |
+
if ( ! empty( $termAs ) ) {
|
843 |
+
foreach ( $termAs as $term ) {
|
844 |
+
$isoFilter[] = "iso_" . $term->term_id;
|
845 |
+
$isoFilter[] = "rt-item-" . esc_attr( $term->slug );
|
846 |
+
}
|
847 |
+
}
|
848 |
+
$arg['isoFilter'] = ! empty( $isoFilter ) ? implode( " ", $isoFilter ) : '';
|
849 |
+
}
|
850 |
+
if ( comments_open() ) {
|
851 |
+
$arg['comment'] = "<a href='" . get_comments_link( $pID ) . "'>{$cc->total_comments} </a>";
|
852 |
+
} else {
|
853 |
+
$arg['comment'] = "{$cc->total_comments}";
|
854 |
+
}
|
855 |
+
$imgSrc = null;
|
856 |
+
|
857 |
+
if ( $isOffset ) {
|
858 |
+
if ( $offLoop == 0 ) {
|
859 |
+
$arg['imgSrc'] = ! $fImg ? rtTPG()->getFeatureImageSrc( $pID, $fImgSize, $mediaSource,
|
860 |
+
$defaultImgId,
|
861 |
+
$customImgSize ) : null;
|
862 |
+
$arg['offset'] = 'big';
|
863 |
+
$offsetBigHtml = rtTPG()->render( 'layouts/' . $layout, $arg, true );
|
864 |
+
} else {
|
865 |
+
$arg['offset'] = 'small';
|
866 |
+
$arg['offsetCol'] = array( $dCol, $tCol, $mCol );
|
867 |
+
$arg['imgSrc'] = ! $fImg ? rtTPG()->getFeatureImageSrc( $pID, 'thumbnail',
|
868 |
+
$mediaSource,
|
869 |
+
$defaultImgId,
|
870 |
+
$customImgSize ) : null;
|
871 |
+
$offsetSmallHtml .= rtTPG()->render( 'layouts/' . $layout, $arg, true );
|
872 |
+
}
|
873 |
+
} else {
|
874 |
+
$arg['imgSrc'] = ! $fImg ? rtTPG()->getFeatureImageSrc( $pID, $fImgSize, $mediaSource,
|
875 |
+
$defaultImgId,
|
876 |
+
$customImgSize ) : null;
|
877 |
+
$html .= rtTPG()->render( 'layouts/' . $layout, $arg, true );
|
878 |
+
}
|
879 |
+
$offLoop ++;
|
880 |
+
$l ++;
|
881 |
+
endwhile;
|
882 |
+
if ( $isOffset ) {
|
883 |
+
$oDCol = rtTPG()->get_offset_col( $dCol );
|
884 |
+
$oTCol = rtTPG()->get_offset_col( $tCol );
|
885 |
+
$oMCol = rtTPG()->get_offset_col( $mCol );
|
886 |
+
if ( $layout == "offset03" || $layout == "offset04" ) {
|
887 |
+
$oDCol['big'] = $oTCol['big'] = $oDCol['small'] = $oTCol['small'] = 6;
|
888 |
+
$oMCol['big'] = $oMCol['small'] = 12;
|
889 |
+
}
|
890 |
+
$html .= "<div class='rt-col-md-{$oDCol['big']} rt-col-sm-{$oTCol['big']} rt-col-xs-{$oMCol['big']}'><div class='rt-row'>{$offsetBigHtml}</div></div>";
|
891 |
+
$html .= "<div class='rt-col-md-{$oDCol['small']} rt-col-sm-{$oTCol['small']} rt-col-xs-{$oMCol['small']}'><div class='rt-row offset-small-wrap'>{$offsetSmallHtml}</div></div>";
|
892 |
+
}
|
893 |
+
if ( $isIsotope || $isCarousel ) {
|
894 |
+
$html .= '</div>'; // End isotope / Carousel item holder
|
895 |
+
}
|
896 |
+
|
897 |
+
} else {
|
898 |
+
$not_found_text = isset( $scMeta['tgp_not_found_text'][0] ) && ! empty( $scMeta['tgp_not_found_text'][0] ) ? esc_attr( $scMeta['tgp_not_found_text'][0] ) : __( 'No post found', 'the-post-grid' );
|
899 |
+
$html .= sprintf( '<p>%s</p>',
|
900 |
+
apply_filters( 'tpg_not_found_text', $not_found_text, $args, $scMeta )
|
901 |
+
);
|
902 |
+
}
|
903 |
+
$html .= $preLoaderHtml;
|
904 |
+
$html .= "</div>"; // End row
|
905 |
+
$htmlUtility = null;
|
906 |
+
if ( $pagination && ! $isCarousel ) {
|
907 |
+
if ( $isOffset ) {
|
908 |
+
$posts_loading_type = "page_prev_next";
|
909 |
+
$htmlUtility .= "<div class='rt-cb-page-prev-next'>
|
910 |
+
<span class='rt-cb-prev-btn'><i class='fa fa-angle-left' aria-hidden='true'></i></span>
|
911 |
+
<span class='rt-cb-next-btn'><i class='fa fa-angle-right' aria-hidden='true'></i></span>
|
912 |
+
</div>";
|
913 |
+
} else {
|
914 |
+
$hide = ( $gridQuery->max_num_pages < 2 ? " rt-hidden-elm" : null );
|
915 |
+
if ( $posts_loading_type == "pagination" ) {
|
916 |
+
if ( $isGrid && empty( $filters ) ) {
|
917 |
+
$htmlUtility .= rtTPG()->rt_pagination( $gridQuery,
|
918 |
+
$args['posts_per_page'] );
|
919 |
+
}
|
920 |
+
} elseif ( $posts_loading_type == "pagination_ajax" && ! $isIsotope ) {
|
921 |
+
$htmlUtility .= "<div class='rt-page-numbers'></div>";
|
922 |
+
} elseif ( $posts_loading_type == "load_more" && rtTPG()->hasPro() ) {
|
923 |
+
$htmlUtility .= "<div class='rt-loadmore-btn rt-loadmore-action rt-loadmore-style{$hide}'>
|
924 |
+
<span class='rt-loadmore-text'>" . __( 'Load More', 'the-post-grid' ) . "</span>
|
925 |
+
<div class='rt-loadmore-loading rt-ball-scale-multiple rt-2x'><div></div><div></div><div></div></div>
|
926 |
+
</div>";
|
927 |
+
|
928 |
+
} elseif ( $posts_loading_type == "load_on_scroll" && rtTPG()->hasPro() ) {
|
929 |
+
$htmlUtility .= "<div class='rt-infinite-action'>
|
930 |
+
<div class='rt-infinite-loading la-fire la-2x'>
|
931 |
+
<div></div>
|
932 |
+
<div></div>
|
933 |
+
<div></div>
|
934 |
+
</div>
|
935 |
+
</div>";
|
936 |
+
}
|
937 |
+
}
|
938 |
+
}
|
939 |
+
|
940 |
+
if ( $htmlUtility ) {
|
941 |
+
$l4toggle = null;
|
942 |
+
if ( $layout == "layout4" ) {
|
943 |
+
$l4toggle = "data-l4toggle='{$this->l4toggle}'";
|
944 |
+
}
|
945 |
+
$html .= "<div class='rt-pagination-wrap' data-total-pages='{$gridQuery->max_num_pages}' data-posts-per-page='{$args['posts_per_page']}' data-type='{$posts_loading_type}' {$l4toggle} >" . $htmlUtility . "</div>";
|
946 |
+
}
|
947 |
+
|
948 |
+
$html .= "</div>"; // container rt-tpg
|
949 |
+
|
950 |
+
wp_reset_postdata();
|
951 |
+
|
952 |
+
$scriptGenerator = array();
|
953 |
+
$scriptGenerator['layout'] = $layoutID;
|
954 |
+
$scriptGenerator['rand'] = $rand;
|
955 |
+
$scriptGenerator['scMeta'] = $scMeta;
|
956 |
+
$scriptGenerator['isCarousel'] = $isCarousel;
|
957 |
+
$scriptGenerator['isSinglePopUp'] = $isSinglePopUp;
|
958 |
+
$scriptGenerator['isWooCom'] = $isWooCom;
|
959 |
+
$this->scA[] = $scriptGenerator;
|
960 |
+
add_action( 'wp_footer', array( $this, 'register_sc_scripts' ) );
|
961 |
+
} else {
|
962 |
+
$html .= "<p>" . __( "No shortCode found", "the-post-grid" ) . "</p>";
|
963 |
+
}
|
964 |
+
|
965 |
+
//restriction issue
|
966 |
+
$restriction = ( ! empty( $scMeta['restriction_user_role'] ) ? $scMeta['restriction_user_role'] : array() );
|
967 |
+
if ( ! empty( $restriction ) ) {
|
968 |
+
if ( is_user_logged_in() ) {
|
969 |
+
$currentUserRoles = rtTPG()->getCurrentUserRoles();
|
970 |
+
if ( in_array( 'administrator', $currentUserRoles ) ) {
|
971 |
+
$html = $html;
|
972 |
+
} else {
|
973 |
+
if ( count( array_intersect( $restriction, $currentUserRoles ) ) ) {
|
974 |
+
$html = $html;
|
975 |
+
} else {
|
976 |
+
$html = "<p>" . __( "You are not permitted to view this content.",
|
977 |
+
"the-post-grid" ) . "</p>";
|
978 |
+
}
|
979 |
+
}
|
980 |
+
|
981 |
+
} else {
|
982 |
+
$html = "<p>" . __( "This is a restricted content, you need to logged in to view this content.",
|
983 |
+
"the-post-grid" ) . "</p>";
|
984 |
+
}
|
985 |
+
}
|
986 |
+
|
987 |
+
return $html;
|
988 |
+
}
|
989 |
+
|
990 |
+
public function order_by_popularity_post_clauses( $args ) {
|
991 |
+
global $wpdb;
|
992 |
+
$args['orderby'] = "$wpdb->postmeta.meta_value+0 DESC, $wpdb->posts.post_date DESC";
|
993 |
+
|
994 |
+
return $args;
|
995 |
+
}
|
996 |
+
}
|
997 |
+
endif;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/templates/layouts/isotope1.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
$html = $htmlDetail = $iTitle = null;
|
4 |
if(in_array('title', $items)){
|
5 |
-
$iTitle =
|
6 |
}
|
7 |
|
8 |
$html .= sprintf('<div class="%s" data-id="%d">', esc_attr(implode(" ", array_filter([$grid, $class, $isoFilter]))), $pID);
|
2 |
|
3 |
$html = $htmlDetail = $iTitle = null;
|
4 |
if(in_array('title', $items)){
|
5 |
+
$iTitle = sprintf('<%1$s class="entry-title"><a data-id="%2$s" class="%3$s" href="%4$s"%5$s>%6$s</a></%1$s>', $title_tag,$pID,$anchorClass,$pLink,$link_target,$title);
|
6 |
}
|
7 |
|
8 |
$html .= sprintf('<div class="%s" data-id="%d">', esc_attr(implode(" ", array_filter([$grid, $class, $isoFilter]))), $pID);
|
lib/templates/layouts/layout1.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
$html = $htmlDetail = $metaHtml = $iTitle = null;
|
4 |
if(in_array('title', $items)){
|
5 |
-
$iTitle =
|
6 |
}
|
7 |
|
8 |
$html .= sprintf('<div class="%s" data-id="%d">', esc_attr(implode(" ", [$grid, $class])), $pID);
|
2 |
|
3 |
$html = $htmlDetail = $metaHtml = $iTitle = null;
|
4 |
if(in_array('title', $items)){
|
5 |
+
$iTitle = sprintf('<%1$s class="entry-title"><a data-id="%2$s" class="%3$s" href="%4$s"%5$s>%6$s</a></%1$s>', $title_tag,$pID,$anchorClass,$pLink,$link_target,$title);
|
6 |
}
|
7 |
|
8 |
$html .= sprintf('<div class="%s" data-id="%d">', esc_attr(implode(" ", [$grid, $class])), $pID);
|
lib/templates/layouts/layout2.php
CHANGED
@@ -17,7 +17,7 @@ $html .= sprintf('<div class="%s" data-id="%d">', esc_attr(implode(" ", [$grid,
|
|
17 |
$html .= "<div class='{$content_area}'>";
|
18 |
|
19 |
if(in_array('title', $items)){
|
20 |
-
$htmlDetail .=
|
21 |
}
|
22 |
|
23 |
$metaHtml = null;
|
17 |
$html .= "<div class='{$content_area}'>";
|
18 |
|
19 |
if(in_array('title', $items)){
|
20 |
+
$htmlDetail .= sprintf('<%1$s class="entry-title"><a data-id="%2$s" class="%3$s" href="%4$s"%5$s>%6$s</a></%1$s>', $title_tag,$pID,$anchorClass,$pLink,$link_target,$title);
|
21 |
}
|
22 |
|
23 |
$metaHtml = null;
|
lib/templates/layouts/layout3.php
CHANGED
@@ -17,7 +17,7 @@ $html .= sprintf('<div class="%s" data-id="%d">', esc_attr(implode(" ", [$grid,
|
|
17 |
$html .= "<div class='{$content_area}'>";
|
18 |
|
19 |
if(in_array('title', $items)){
|
20 |
-
$htmlDetail .=
|
21 |
}
|
22 |
|
23 |
$metaHtml = null;
|
17 |
$html .= "<div class='{$content_area}'>";
|
18 |
|
19 |
if(in_array('title', $items)){
|
20 |
+
$htmlDetail .= sprintf('<%1$s class="entry-title"><a data-id="%2$s" class="%3$s" href="%4$s"%5$s>%6$s</a></%1$s>', $title_tag,$pID,$anchorClass,$pLink,$link_target,$title);
|
21 |
}
|
22 |
|
23 |
$metaHtml = null;
|
lib/views/settings/post-source.php
CHANGED
@@ -23,6 +23,7 @@ echo $sHtml;
|
|
23 |
foreach($advFilters['post_filter']['options'] as $key => $filter){
|
24 |
if($key == 'tpg_taxonomy'){
|
25 |
$html .= "<div class='rt-tpg-filter taxonomy tpg_taxonomy tpg-hidden'>";
|
|
|
26 |
if(isset($pt) && $pt){
|
27 |
$taxonomies = rtTPG()->rt_get_all_taxonomy_by_post_type($pt);
|
28 |
$taxA = get_post_meta($post->ID, 'tpg_taxonomy');
|
23 |
foreach($advFilters['post_filter']['options'] as $key => $filter){
|
24 |
if($key == 'tpg_taxonomy'){
|
25 |
$html .= "<div class='rt-tpg-filter taxonomy tpg_taxonomy tpg-hidden'>";
|
26 |
+
|
27 |
if(isset($pt) && $pt){
|
28 |
$taxonomies = rtTPG()->rt_get_all_taxonomy_by_post_type($pt);
|
29 |
$taxA = get_post_meta($post->ID, 'tpg_taxonomy');
|
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: 3.0.
|
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: 3.0.2
|
8 |
* Text Domain: the-post-grid
|
9 |
* Domain Path: /languages
|
10 |
* Author URI: https://radiustheme.com/
|