Premium Addons for Elementor - Version 3.0.5

Version Description

  • Tweak: Added Filter by Author option in Premium Blog widget to get posts for specific author(s).
  • Tweak: Added Filter by Tag option in Premium Blog widget to get posts for specific tag(s).
  • Tweak: Added Posts to Exclude option in Premium Blog widget.
  • Tweak: Added Order By option in Premium Blog widget to order posts based on post author, ID, title, name, date, modification date, random.
  • Tweak: Added Order option in Premium Blog widget to have ascending/descending order of the posts.
  • Tweak: Added responsive controls for Number of Columns option in Premium Blog widget.
  • Tweak: Inline CSS removed in Premium Blog widget.
Download this release

Release Info

Developer leap13
Plugin Icon 128x128 Premium Addons for Elementor
Version 3.0.5
Comparing to
See all releases

Code changes from version 3.0.4 to 3.0.5

admin/assets/pa-elements-font/css/pa-elements.css CHANGED
@@ -8,7 +8,9 @@
8
font-weight: normal;
9
font-style: normal;
10
}
11
-
12
[class^="pa-"], [class*=" pa-"] {
13
/* use !important to prevent issues with browser extensions that change fonts */
14
font-family: 'pa-elements' !important;
@@ -23,7 +25,16 @@
23
-webkit-font-smoothing: antialiased;
24
-moz-osx-font-smoothing: grayscale;
25
}
26
-
27
.pa-pa-admin-icon:before {
28
content: "\e915";
29
}
8
font-weight: normal;
9
font-style: normal;
10
}
11
+ .elementor-element .icon {
12
+ position: relative;
13
+ }
14
[class^="pa-"], [class*=" pa-"] {
15
/* use !important to prevent issues with browser extensions that change fonts */
16
font-family: 'pa-elements' !important;
25
-webkit-font-smoothing: antialiased;
26
-moz-osx-font-smoothing: grayscale;
27
}
28
+ /*
29
+ * Icons Badge
30
+ */
31
+ /*[class^="pa-"]::after, [class*=" pa-"]::after {
32
+ font-size: 10px;
33
+ opacity: 0.4;
34
+ position: absolute;
35
+ right: 5px;
36
+ top: 5px;
37
+ }*/
38
.pa-pa-admin-icon:before {
39
content: "\e915";
40
}
admin/settings/version-control.php CHANGED
@@ -79,7 +79,7 @@ class PA_Version_Control {
79
<tr class="pa-roll-row">
80
<th>Rollback Version</th>
81
<td>
82
- <div><?php echo sprintf( '<a target="_blank" href="%s" class="button pa-btn pa-rollback-button elementor-button-spinner">Reinstall Version 3.0.3</a>', wp_nonce_url( admin_url( 'admin-post.php?action=premium_addons_rollback' ), 'premium_addons_rollback' ) ); ?> </div>
83
<p class="pa-roll-desc"><span>Warning: Please backup your database before making the rollback.</span></p>
84
</td>
85
</tr>
79
<tr class="pa-roll-row">
80
<th>Rollback Version</th>
81
<td>
82
+ <div><?php echo sprintf( '<a target="_blank" href="%s" class="button pa-btn pa-rollback-button elementor-button-spinner">Reinstall Version 3.0.4</a>', wp_nonce_url( admin_url( 'admin-post.php?action=premium_addons_rollback' ), 'premium_addons_rollback' ) ); ?> </div>
83
<p class="pa-roll-desc"><span>Warning: Please backup your database before making the rollback.</span></p>
84
</td>
85
</tr>
assets/css/premium-addons.css CHANGED
@@ -776,7 +776,7 @@
776
}
777
778
.countdown .pre_countdown-section:last-child {
779
- margin-right: 0;
780
}
781
782
.countdown span.pre_countdown-amount {
@@ -785,13 +785,13 @@
785
}
786
787
.countdown .pre_time-mid {
788
- display: block;
789
}
790
/************************************
791
* Digit and unit styles
792
*************************************/
793
.side .pre_countdown-section .pre_countdown-period {
794
- vertical-align: bottom;
795
796
}
797
.countdown .pre_countdown-section .pre_countdown-period {
@@ -803,18 +803,18 @@
803
*************************************/
804
.side .pre_countdown-section .pre_countdown-amount,
805
.side .pre_countdown-section .pre_countdown-period {
806
- display: inline-block;
807
}
808
809
.side .pre_countdown-section .pre_countdown-amount {
810
- margin-right: 5px;
811
}
812
/************************************
813
* Digit and unit up and down
814
*************************************/
815
.down .pre_countdown-section .pre_countdown-amount,
816
.down .pre_countdown-section .pre_countdown-period {
817
- display: block;
818
}
819
/**************** Premium Carousel **************/
820
/************************************************/
@@ -865,14 +865,14 @@ a.ver-carousel-arrow.carousel-prev {
865
top: -45px;
866
}
867
a.circle-bg {
868
- border-radius: 100%;
869
}
870
a.circle-border {
871
- border-radius: 100%;
872
- border: solid black;
873
}
874
a.square-border {
875
- border: solid black;
876
}
877
ul.slick-dots {
878
list-style: none;
@@ -880,7 +880,7 @@ ul.slick-dots {
880
margin-left: 0;
881
}
882
ul.slick-dots li {
883
- font-size: 10px;
884
display: inline-block;
885
margin: 5px;
886
width: 20px;
@@ -936,28 +936,28 @@ ul.slick-dots li {
936
/**************** Premium Counter ***************/
937
/************************************************/
938
.premium-counter-area {
939
- padding: 10px 0;
940
}
941
.premium-counter-area .premium-counter-icon span.icon {
942
- width: 1em;
943
height: 1em;
944
line-height: 1em;
945
- text-align: center;
946
- display: inline-block;
947
- vertical-align: middle;
948
}
949
.premium-counter-area .premium-counter-title {
950
- padding: 0;
951
- margin: 0;
952
}
953
.premium-counter-icon .icon i.fa:before {
954
- vertical-align: text-top;
955
}
956
/*
957
* Circle Icon style
958
*/
959
.premium-counter-area .premium-counter-icon .circle {
960
- border-radius: 100%;
961
}
962
963
.premium-counter-area.center {
@@ -975,7 +975,7 @@ ul.slick-dots li {
975
padding-right: 20px;
976
}
977
.premium-init-wrapper.right {
978
- text-align: right;
979
}
980
/*
981
* Custom image and simple styles image fix
@@ -991,9 +991,9 @@ span.icon.flex-width {
991
/*********************************************************/
992
/*Image Separator Container Style*/
993
.premium-image-separator-container{
994
- position: absolute;
995
width: 100%;
996
- z-index: 2;
997
top: auto;
998
}
999
/*Link on Image Style*/
@@ -1307,7 +1307,7 @@ button.premium-modal-box-modal-close {
1307
line-height: 20px;
1308
}
1309
.premium-progressbar-container .clearfix {
1310
- clear: both;
1311
}
1312
/*Progress Bar Style*/
1313
.premium-progressbar-progress-bar {
@@ -1319,13 +1319,13 @@ button.premium-modal-box-modal-close {
1319
}
1320
/*Left Label Style*/
1321
.premium-progressbar-container p:first-of-type{
1322
- margin:0;
1323
- float:left;
1324
}
1325
/*Right Label Style*/
1326
.premium-progressbar-container p:nth-of-type(2){
1327
- margin: 0;
1328
- float: right;
1329
}
1330
.premium-progressbar-name{
1331
left:50%;
@@ -1979,30 +1979,45 @@ button.premium-modal-box-modal-close {
1979
border-radius: 0;
1980
font-size: 17.8px;
1981
}
1982
- .premium-blog-wrap.col-3 .premium-blog-entry-meta,
1983
- .premium-blog-wrap.col-3 .premium-blog-post-content,
1984
- .premium-blog-wrap.col-3 .premium-blog-post-tags-container,
1985
- .premium-blog-wrap.col-4 .premium-blog-entry-meta,
1986
- .premium-blog-wrap.col-4 .premium-blog-post-content,
1987
- .premium-blog-wrap.col-4 .premium-blog-post-tags-container {
1988
margin-left: 0;
1989
}
1990
- .premium-blog-wrap.col-3 .premium-blog-format-container,
1991
- .premium-blog-wrap.col-4 .premium-blog-format-container {
1992
display: none;
1993
}
1994
- .premium-blog-wrap.col-3 .premium-blog-entry-title,
1995
- .premium-blog-wrap.col-4 .premium-blog-entry-title {
1996
line-height: 1;
1997
}
1998
- .premium-blog-wrap.col-3 .premium-blog-entry-title a,
1999
- .premium-blog-wrap.col-4 .premium-blog-entry-title a{
2000
font-size: 20px;
2001
}
2002
@media ( max-width: 768px ) {
2003
.premium-blog-content-wrapper {
2004
top: 0;
2005
margin: 0;
2006
}
2007
.premium-blog-thumb-effect-wrapper {
2008
margin-bottom: 15px;
@@ -2010,12 +2025,18 @@ button.premium-modal-box-modal-close {
2010
.premium-blog-format-container {
2011
display: none;
2012
}
2013
.premium-blog-entry-meta,
2014
.premium-blog-post-content {
2015
margin-left: 0px;
2016
}
2017
- .premium-blog-post-tags-container {
2018
- margin-left: 0px;
2019
}
2020
}
2021
/**************** Premium Person ******************/
@@ -2210,41 +2231,41 @@ button.premium-modal-box-modal-close {
2210
.premium-dual-header-second-header.gradient {
2211
background-size: 300% 300% !important;
2212
-webkit-animation: Gradient 10s ease-in-out infinite;
2213
- -moz-animation: Gradient 10s ease-in-out infinite;
2214
- animation: Gradient 10s ease-in-out infinite;
2215
}
2216
@-webkit-keyframes Gradient {
2217
- 0% {
2218
- background-position: 0% 50%
2219
- }
2220
- 50% {
2221
- background-position: 100% 50%
2222
- }
2223
- 100% {
2224
- background-position: 0% 50%
2225
- }
2226
}
2227
@-moz-keyframes Gradient {
2228
- 0% {
2229
- background-position: 0% 50%
2230
- }
2231
- 50% {
2232
- background-position: 100% 50%
2233
- }
2234
- 100% {
2235
- background-position: 0% 50%
2236
- }
2237
}
2238
@keyframes Gradient {
2239
- 0% {
2240
- background-position: 0% 50%
2241
- }
2242
- 50% {
2243
- background-position: 100% 50%
2244
- }
2245
- 100% {
2246
- background-position: 0% 50%
2247
- }
2248
}
2249
/**************** Premium Fancy Text *******************/
2250
/*******************************************************/
@@ -2284,17 +2305,17 @@ button.premium-modal-box-modal-close {
2284
}
2285
.premium-badge-left .corner {
2286
width: 0;
2287
- height: 0;
2288
- border-top: 150px solid;
2289
- border-bottom: 150px solid transparent;
2290
- border-right: 150px solid transparent;
2291
}
2292
.premium-badge-right .corner {
2293
width: 0;
2294
- height: 0;
2295
- border-bottom: 150px solid transparent;
2296
- border-right: 150px solid;
2297
- border-left: 150px solid transparent;
2298
}
2299
.premium-badge-left span,
2300
.premium-badge-right span{
776
}
777
778
.countdown .pre_countdown-section:last-child {
779
+ margin-right: 0;
780
}
781
782
.countdown span.pre_countdown-amount {
785
}
786
787
.countdown .pre_time-mid {
788
+ display: block;
789
}
790
/************************************
791
* Digit and unit styles
792
*************************************/
793
.side .pre_countdown-section .pre_countdown-period {
794
+ vertical-align: bottom;
795
796
}
797
.countdown .pre_countdown-section .pre_countdown-period {
803
*************************************/
804
.side .pre_countdown-section .pre_countdown-amount,
805
.side .pre_countdown-section .pre_countdown-period {
806
+ display: inline-block;
807
}
808
809
.side .pre_countdown-section .pre_countdown-amount {
810
+ margin-right: 5px;
811
}
812
/************************************
813
* Digit and unit up and down
814
*************************************/
815
.down .pre_countdown-section .pre_countdown-amount,
816
.down .pre_countdown-section .pre_countdown-period {
817
+ display: block;
818
}
819
/**************** Premium Carousel **************/
820
/************************************************/
865
top: -45px;
866
}
867
a.circle-bg {
868
+ border-radius: 100%;
869
}
870
a.circle-border {
871
+ border-radius: 100%;
872
+ border: solid black;
873
}
874
a.square-border {
875
+ border: solid black;
876
}
877
ul.slick-dots {
878
list-style: none;
880
margin-left: 0;
881
}
882
ul.slick-dots li {
883
+ font-size: 10px;
884
display: inline-block;
885
margin: 5px;
886
width: 20px;
936
/**************** Premium Counter ***************/
937
/************************************************/
938
.premium-counter-area {
939
+ padding: 10px 0;
940
}
941
.premium-counter-area .premium-counter-icon span.icon {
942
+ width: 1em;
943
height: 1em;
944
line-height: 1em;
945
+ text-align: center;
946
+ display: inline-block;
947
+ vertical-align: middle;
948
}
949
.premium-counter-area .premium-counter-title {
950
+ padding: 0;
951
+ margin: 0;
952
}
953
.premium-counter-icon .icon i.fa:before {
954
+ vertical-align: text-top;
955
}
956
/*
957
* Circle Icon style
958
*/
959
.premium-counter-area .premium-counter-icon .circle {
960
+ border-radius: 100%;
961
}
962
963
.premium-counter-area.center {
975
padding-right: 20px;
976
}
977
.premium-init-wrapper.right {
978
+ text-align: right;
979
}
980
/*
981
* Custom image and simple styles image fix
991
/*********************************************************/
992
/*Image Separator Container Style*/
993
.premium-image-separator-container{
994
+ position: absolute;
995
width: 100%;
996
+ z-index: 2;
997
top: auto;
998
}
999
/*Link on Image Style*/
1307
line-height: 20px;
1308
}
1309
.premium-progressbar-container .clearfix {
1310
+ clear: both;
1311
}
1312
/*Progress Bar Style*/
1313
.premium-progressbar-progress-bar {
1319
}
1320
/*Left Label Style*/
1321
.premium-progressbar-container p:first-of-type{
1322
+ margin:0;
1323
+ float:left;
1324
}
1325
/*Right Label Style*/
1326
.premium-progressbar-container p:nth-of-type(2){
1327
+ margin: 0;
1328
+ float: right;
1329
}
1330
.premium-progressbar-name{
1331
left:50%;
1979
border-radius: 0;
1980
font-size: 17.8px;
1981
}
1982
+ .premium-blog-wrap {
1983
+ display: -ms-flexbox;
1984
+ display: -webkit-flex;
1985
+ display: -moz-flex;
1986
+ display: -ms-flex;
1987
+ display: flex;
1988
+ -webkit-flex-wrap: wrap;
1989
+ flex-wrap: wrap;
1990
+ }
1991
+ .premium-blog-wrap.premium-blog-col-3 .premium-blog-entry-meta,
1992
+ .premium-blog-wrap.premium-blog-col-3 .premium-blog-post-content,
1993
+ .premium-blog-wrap.premium-blog-col-3 .premium-blog-post-tags-container,
1994
+ .premium-blog-wrap.premium-blog-col-4 .premium-blog-entry-meta,
1995
+ .premium-blog-wrap.premium-blog-col-4 .premium-blog-post-content,
1996
+ .premium-blog-wrap.premium-blog-col-4 .premium-blog-post-tags-container {
1997
margin-left: 0;
1998
}
1999
+ .premium-blog-wrap.premium-blog-col-3 .premium-blog-format-container,
2000
+ .premium-blog-wrap.premium-blog-col-4 .premium-blog-format-container {
2001
display: none;
2002
}
2003
+ .premium-blog-wrap.premium-blog-col-3 .premium-blog-entry-title,
2004
+ .premium-blog-wrap.premium-blog-col-4 .premium-blog-entry-title {
2005
line-height: 1;
2006
}
2007
+ .premium-blog-wrap.premium-blog-col-3 .premium-blog-entry-title a,
2008
+ .premium-blog-wrap.premium-blog-col-4 .premium-blog-entry-title a{
2009
font-size: 20px;
2010
}
2011
+ @media ( max-width: 1025px ) {
2012
+ .premium-blog-entry-title a {
2013
+ font-size: 18px;
2014
+ }
2015
+ }
2016
@media ( max-width: 768px ) {
2017
.premium-blog-content-wrapper {
2018
top: 0;
2019
margin: 0;
2020
+ padding: 15px;
2021
}
2022
.premium-blog-thumb-effect-wrapper {
2023
margin-bottom: 15px;
2025
.premium-blog-format-container {
2026
display: none;
2027
}
2028
+ .premium-blog-entry-title {
2029
+ line-height: 1;
2030
+ }
2031
+ .premium-blog-entry-title a {
2032
+ font-size: 16px;
2033
+ }
2034
.premium-blog-entry-meta,
2035
.premium-blog-post-content {
2036
margin-left: 0px;
2037
}
2038
+ .premium-blog-post-tags-container {
2039
+ margin-left: 0px;
2040
}
2041
}
2042
/**************** Premium Person ******************/
2231
.premium-dual-header-second-header.gradient {
2232
background-size: 300% 300% !important;
2233
-webkit-animation: Gradient 10s ease-in-out infinite;
2234
+ -moz-animation: Gradient 10s ease-in-out infinite;
2235
+ animation: Gradient 10s ease-in-out infinite;
2236
}
2237
@-webkit-keyframes Gradient {
2238
+ 0% {
2239
+ background-position: 0% 50%
2240
+ }
2241
+ 50% {
2242
+ background-position: 100% 50%
2243
+ }
2244
+ 100% {
2245
+ background-position: 0% 50%
2246
+ }
2247
}
2248
@-moz-keyframes Gradient {
2249
+ 0% {
2250
+ background-position: 0% 50%
2251
+ }
2252
+ 50% {
2253
+ background-position: 100% 50%
2254
+ }
2255
+ 100% {
2256
+ background-position: 0% 50%
2257
+ }
2258
}
2259
@keyframes Gradient {
2260
+ 0% {
2261
+ background-position: 0% 50%
2262
+ }
2263
+ 50% {
2264
+ background-position: 100% 50%
2265
+ }
2266
+ 100% {
2267
+ background-position: 0% 50%
2268
+ }
2269
}
2270
/**************** Premium Fancy Text *******************/
2271
/*******************************************************/
2305
}
2306
.premium-badge-left .corner {
2307
width: 0;
2308
+ height: 0;
2309
+ border-top: 150px solid;
2310
+ border-bottom: 150px solid transparent;
2311
+ border-right: 150px solid transparent;
2312
}
2313
.premium-badge-right .corner {
2314
width: 0;
2315
+ height: 0;
2316
+ border-bottom: 150px solid transparent;
2317
+ border-right: 150px solid;
2318
+ border-left: 150px solid transparent;
2319
}
2320
.premium-badge-left span,
2321
.premium-badge-right span{
includes/class-addons-integration.php CHANGED
@@ -44,6 +44,10 @@ class Premium_Addons_Integration {
44
PREMIUM_ADDONS_URL . 'admin/assets/pa-elements-font/css/pa-elements.css'
45
);
46
47
}
48
49
/**
44
PREMIUM_ADDONS_URL . 'admin/assets/pa-elements-font/css/pa-elements.css'
45
);
46
47
+ // $dynamic_css = '[class^="pa-"]::after, [class*=" pa-"]::after { content: "Hssssssssssello"; }';
48
+
49
+ // wp_add_inline_style( 'pa-icons-badge', $dynamic_css );
50
+
51
}
52
53
/**
premium-addons-for-elementor.php CHANGED
@@ -3,7 +3,7 @@
3
Plugin Name: Premium Addons for Elementor
4
Description: Premium Addons Plugin Includes 21+ premium widgets for Elementor Page Builder.
5
Plugin URI: https://premiumaddons.com
6
- Version: 3.0.4
7
Author: Leap13
8
Author URI: http://leap13.com/
9
Text Domain: premium-addons-for-elementor
@@ -21,13 +21,14 @@ if (! function_exists('add_action')) {
21
22
if ( ! defined('ABSPATH') ) exit; // No access of directly access
23
24
// Define Constants
25
- define('PREMIUM_ADDONS_VERSION', '3.0.4');
26
define('PREMIUM_ADDONS_URL', plugins_url('/', __FILE__));
27
define('PREMIUM_ADDONS_PATH', plugin_dir_path(__FILE__));
28
define('PREMIUM_ADDONS_FILE', __FILE__);
29
define('PREMIUM_ADDONS_BASENAME', plugin_basename(__FILE__));
30
- define('PREMIUM_ADDONS_STABLE_VERSION', '3.0.3');
31
32
if( ! class_exists('Premium_Addons_Elementor') ) {
33
/*
@@ -48,6 +49,7 @@ if( ! class_exists('Premium_Addons_Elementor') ) {
48
add_action('plugins_loaded', array( $this, 'premium_addons_elementor_setup') );
49
50
register_activation_hook(__FILE__, array( $this, 'pa_activation') );
51
add_action('admin_init', array( $this, 'pa_redirection' ) );
52
53
add_action('elementor/init', array( $this, 'create_premium_category') );
3
Plugin Name: Premium Addons for Elementor
4
Description: Premium Addons Plugin Includes 21+ premium widgets for Elementor Page Builder.
5
Plugin URI: https://premiumaddons.com
6
+ Version: 3.0.5
7
Author: Leap13
8
Author URI: http://leap13.com/
9
Text Domain: premium-addons-for-elementor
21
22
if ( ! defined('ABSPATH') ) exit; // No access of directly access
23
24
+
25
// Define Constants
26
+ define('PREMIUM_ADDONS_VERSION', '3.0.5');
27
define('PREMIUM_ADDONS_URL', plugins_url('/', __FILE__));
28
define('PREMIUM_ADDONS_PATH', plugin_dir_path(__FILE__));
29
define('PREMIUM_ADDONS_FILE', __FILE__);
30
define('PREMIUM_ADDONS_BASENAME', plugin_basename(__FILE__));
31
+ define('PREMIUM_ADDONS_STABLE_VERSION', '3.0.4');
32
33
if( ! class_exists('Premium_Addons_Elementor') ) {
34
/*
49
add_action('plugins_loaded', array( $this, 'premium_addons_elementor_setup') );
50
51
register_activation_hook(__FILE__, array( $this, 'pa_activation') );
52
+
53
add_action('admin_init', array( $this, 'pa_redirection' ) );
54
55
add_action('elementor/init', array( $this, 'create_premium_category') );
queries.php CHANGED
@@ -2,30 +2,47 @@
2
3
if (!defined('ABSPATH')) exit;
4
5
- function premium_blog_get_post_data($args, $paged, $new_offset){
6
$defaults = array(
7
'category' => '',
8
'posts_per_page' => 1,
9
'paged' => $paged,
10
'offset' => $new_offset,
11
);
12
-
13
- $atts = wp_parse_args($args,$defaults);
14
-
15
- $posts = get_posts($atts);
16
-
17
return $posts;
18
}
19
20
- function premium_blog_get_post_settings($settings){
21
$post_args['category'] = $settings['premium_blog_categories'];
22
$post_args['posts_per_page'] = $settings['premium_blog_number_of_posts'];
23
24
return $post_args;
25
}
26
27
- function premium_addons_get_excerpt_by_id($post_id,$excerpt_length,$excerpt_type,$exceprt_text){
28
- $the_post = get_post($post_id); //Gets post ID
29
30
$the_excerpt = null;
31
if ($the_post)
@@ -50,18 +67,67 @@ function premium_addons_get_excerpt_by_id($post_id,$excerpt_length,$excerpt_type
50
return $the_excerpt;
51
}
52
53
- function premium_addons_post_type_categories(){
54
- $terms = get_terms( array(
55
- 'taxonomy' => 'category',
56
- 'hide_empty' => true,
57
- ));
58
59
$options = array();
60
if ( ! empty( $terms ) && ! is_wp_error( $terms ) ){
61
- foreach ( $terms as $term ) {
62
- $options[ $term->term_id ] = $term->name;
63
}
64
}
65
66
return $options;
67
}
2
3
if (!defined('ABSPATH')) exit;
4
5
+ function premium_blog_get_post_data( $args, $paged, $new_offset ) {
6
+
7
$defaults = array(
8
+ 'author' => '',
9
'category' => '',
10
+ 'orderby' => '',
11
'posts_per_page' => 1,
12
'paged' => $paged,
13
'offset' => $new_offset,
14
);
15
+
16
+ $atts = wp_parse_args( $args, $defaults );
17
+
18
+ $posts = get_posts( $atts );
19
+
20
return $posts;
21
}
22
23
+ function premium_blog_get_post_settings( $settings ) {
24
+
25
+ $authors = $settings['premium_blog_users'];
26
+
27
+ $post_args['author'] = implode(',', $authors);
28
+
29
$post_args['category'] = $settings['premium_blog_categories'];
30
+
31
+ $post_args['tag__in'] = $settings['premium_blog_tags'];
32
+
33
+ $post_args['post__not_in'] = $settings['premium_blog_posts_exclude'];
34
+
35
+ $post_args['order'] = $settings['premium_blog_order'];
36
+
37
+ $post_args['orderby'] = $settings['premium_blog_order_by'];
38
+
39
$post_args['posts_per_page'] = $settings['premium_blog_number_of_posts'];
40
41
return $post_args;
42
}
43
44
+ function premium_addons_get_excerpt_by_id( $post_id, $excerpt_length, $excerpt_type, $exceprt_text ){
45
+ $the_post = get_post($post_id);
46
47
$the_excerpt = null;
48
if ($the_post)
67
return $the_excerpt;
68
}
69
70
+ function premium_addons_post_type_categories() {
71
+ $terms = get_terms(
72
+ array(
73
+ 'taxonomy' => 'category',
74
+ 'hide_empty' => true,
75
+ )
76
+ );
77
78
$options = array();
79
+
80
if ( ! empty( $terms ) && ! is_wp_error( $terms ) ){
81
+ foreach ( $terms as $term ) {
82
+ $options[ $term->term_id ] = $term->name;
83
+ }
84
}
85
+
86
+ return $options;
87
+ }
88
+
89
+ function premium_addons_post_type_users() {
90
+ $users = get_users();
91
+
92
+ $options = array();
93
+
94
+ if ( ! empty( $users ) && ! is_wp_error( $users ) ){
95
+ foreach ( $users as $user ) {
96
+ if( $user->display_name !== 'wp_update_service' ) {
97
+ $options[ $user->ID ] = $user->display_name;
98
+ }
99
+ }
100
}
101
102
+ return $options;
103
+ }
104
+
105
+ function premium_addons_post_type_tags() {
106
+ $tags = get_tags();
107
+
108
+ $options = array();
109
+
110
+ if ( ! empty( $tags ) && ! is_wp_error( $tags ) ){
111
+ foreach ( $tags as $tag ) {
112
+ $options[ $tag->term_id ] = $tag->name;
113
+ }
114
+ }
115
+
116
+ return $options;
117
+ }
118
+ function premium_addons_posts_list() {
119
+ $list = get_posts( array(
120
+ 'post_type' => 'post',
121
+ 'posts_per_page' => -1,
122
+ ) );
123
+
124
+ $options = array();
125
+
126
+ if ( ! empty( $list ) && ! is_wp_error( $list ) ) {
127
+ foreach ( $list as $post ) {
128
+ $options[ $post->ID ] = $post->post_title;
129
+ }
130
+ }
131
+
132
return $options;
133
}
readme.txt CHANGED
@@ -5,7 +5,7 @@ Donate link: http://premiumaddons.com
5
Requires at least: 4.5
6
Tested up to: 5.0.3
7
Requires PHP: 5.4
8
- Stable tag: 3.0.4
9
License: GPL v3.0
10
License URI: https://opensource.org/licenses/GPL-3.0
11
@@ -137,6 +137,16 @@ Premium Addons for Elementor is 100% Ads Free, Ads can only be detected from You
137
138
== Changelog ==
139
140
= 3.0.4 =
141
142
- Tweak: Added `Border` option for Heading in Premium Modal Box.
5
Requires at least: 4.5
6
Tested up to: 5.0.3
7
Requires PHP: 5.4
8
+ Stable tag: 3.0.5
9
License: GPL v3.0
10
License URI: https://opensource.org/licenses/GPL-3.0
11
137
138
== Changelog ==
139
140
+ = 3.0.5 =
141
+
142
+ - Tweak: Added `Filter by Author` option in Premium Blog widget to get posts for specific author(s).
143
+ - Tweak: Added `Filter by Tag` option in Premium Blog widget to get posts for specific tag(s).
144
+ - Tweak: Added `Posts to Exclude` option in Premium Blog widget.
145
+ - Tweak: Added `Order By` option in Premium Blog widget to order posts based on post author, ID, title, name, date, modification date, random.
146
+ - Tweak: Added `Order` option in Premium Blog widget to have ascending/descending order of the posts.
147
+ - Tweak: Added responsive controls for `Number of Columns` option in Premium Blog widget.
148
+ - Tweak: Inline CSS removed in Premium Blog widget.
149
+
150
= 3.0.4 =
151
152
- Tweak: Added `Border` option for Heading in Premium Modal Box.
widgets/premium-blog.php CHANGED
@@ -33,76 +33,59 @@ class Premium_Blog extends Widget_Base {
33
return [ 'premium-elements' ];
34
}
35
36
- // Adding the controls fields for the premium blog
37
// This will controls the animation, colors and background, dimensions etc
38
protected function _register_controls() {
39
40
- /* Start Content Section */
41
$this->start_controls_section('premium_blog_general_settings',
42
- [
43
- 'label' => __('Image', 'premium-addons-for-elementor'),
44
- ]
45
- );
46
47
- /*Hover Image Effect*/
48
$this->add_control('premium_blog_hover_image_effect',
49
- [
50
- 'label' => __('Hover Effect', 'premium-addons-for-elementor'),
51
- 'type' => Controls_Manager::SELECT,
52
- 'description' => __('Choose a hover effect for the image','premium-addons-for-elementor'),
53
- 'options' => [
54
- 'none' => __('None', 'premium-addons-for-elementor'),
55
- 'zoomin' => __('Zoom In', 'premium-addons-for-elementor'),
56
- 'zoomout'=> __('Zoom Out', 'premium-addons-for-elementor'),
57
- 'scale' => __('Scale', 'premium-addons-for-elementor'),
58
- 'gray' => __('Grayscale', 'premium-addons-for-elementor'),
59
- 'blur' => __('Blur', 'premium-addons-for-elementor'),
60
- 'bright' => __('Bright', 'premium-addons-for-elementor'),
61
- 'sepia' => __('Sepia', 'premium-addons-for-elementor'),
62
- 'trans' => __('Translate', 'premium-addons-for-elementor'),
63
- ],
64
- 'default' => 'zoomin',
65
- 'label_block' => true
66
- ]
67
- );
68
69
- /*Hover Image Effect*/
70
$this->add_control('premium_blog_hover_color_effect',
71
- [
72
- 'label' => __('Color Effect', 'premium-addons-for-elementor'),
73
- 'type' => Controls_Manager::SELECT,
74
- 'description' => __('Choose an overlay color effect','premium-addons-for-elementor'),
75
- 'options' => [
76
- 'none' => __('None', 'premium-addons-for-elementor'),
77
- 'framed' => __('Framed', 'premium-addons-for-elementor'),
78
- 'diagonal' => __('Diagonal', 'premium-addons-for-elementor'),
79
- 'bordered' => __('Bordered', 'premium-addons-for-elementor'),
80
- 'squares' => __('Squares', 'premium-addons-for-elementor'),
81
- ],
82
- 'default' => 'framed',
83
- 'label_block' => true
84
- ]
85
- );
86
87
- /*End Premium Blog*/
88
$this->end_controls_section();
89
90
- /*Start Content Settings Section*/
91
$this->start_controls_section('premium_blog_content_settings',
92
- [
93
- 'label' => __('Content', 'premium-addons-for-elementor'),
94
- ]
95
- );
96
-
97
- /*Categories Filter*/
98
- $this->add_control('premium_blog_categories',
99
[
100
- 'label' => __( 'Categories', 'essential-addons-elementor' ),
101
- 'type' => Controls_Manager::SELECT2,
102
- 'description' => __('Select the categories you want to show','premium-addons-for-elementor'),
103
- 'label_block' => true,
104
- 'multiple' => true,
105
- 'options' => premium_addons_post_type_categories(),
106
]
107
);
108
@@ -113,116 +96,144 @@ class Premium_Blog extends Widget_Base {
113
'type' => Controls_Manager::SELECT,
114
'default' => 'h2',
115
'options' => [
116
- 'h1' => 'H1',
117
- 'h2' => 'H2',
118
- 'h3' => 'H3',
119
- 'h4' => 'H4',
120
- 'h5' => 'H5',
121
- 'h6' => 'H6',
122
- ],
123
'label_block' => true,
124
]
125
);
126
127
- /*Grid*/
128
$this->add_control('premium_blog_grid',
129
- [
130
- 'label' => __('Grid', 'premium-addons-for-elementor'),
131
- 'type' => Controls_Manager::SWITCHER,
132
- ]
133
- );
134
135
- /*Masonry*/
136
$this->add_control('premium_blog_masonry',
137
- [
138
- 'label' => __('Masonry', 'premium-addons-for-elementor'),
139
- 'type' => Controls_Manager::SWITCHER,
140
- 'return_value' => 'true',
141
- 'condition' => [
142
- 'premium_blog_grid' => 'yes'
143
- ]
144
- ]
145
- );
146
-
147
- /*Grid Number of Columns*/
148
- $this->add_control('premium_blog_columns_number',
149
- [
150
- 'label' => __('Number of Columns', 'premium-addons-for-elementor'),
151
- 'type' => Controls_Manager::SELECT,
152
- 'options' => [
153
- '50%' => __('2 Columns', 'premium-addons-for-elementor'),
154
- '33.33%'=> __('3 Columns', 'premium-addons-for-elementor'),
155
- '25%' => __('4 Columns', 'premium-addons-for-elementor'),
156
- ],
157
- 'default' => '50%',
158
- 'selectors' => [
159
- '{{WRAPPER}} .premium-blog-post-container' => 'width: {{VALUE}}; float:left;'
160
- ],
161
- 'condition' => [
162
- 'premium_blog_grid' => 'yes',
163
- ]
164
- ]
165
- );
166
167
- /*Grid Spacing*/
168
$this->add_responsive_control('premium_blog_posts_spacing',
169
- [
170
- 'label' => __('Spacing', 'premium-addons-for-elementor'),
171
- 'type' => Controls_Manager::SLIDER,
172
- 'size_units' => ['px', '%', "em"],
173
- 'range' => [
174
- 'px' => [
175
- 'min' => 1,
176
- 'max' => 200,
177
- ],
178
- ],
179
- 'condition' => [
180
- 'premium_blog_grid' => 'yes'
181
],
182
- 'selectors' => [
183
- '{{WRAPPER}} .premium-blog-post-container' => 'padding: {{SIZE}}{{UNIT}};'
184
- ]
185
- ]
186
- );
187
188
- /*Excerpt*/
189
$this->add_control('premium_blog_excerpt',
190
- [
191
- 'label' => __('Excerpt', 'premium-addons-for-elementor'),
192
- 'type' => Controls_Manager::SWITCHER,
193
- 'description' => __('Excerpt is used for article summary with a link to the whole entry. The default except length is 55','premium-addons-for-elementor'),
194
- 'default' => 'yes',
195
- ]
196
- );
197
198
- /*Excerpt Length*/
199
$this->add_control('premium_blog_excerpt_length',
200
- [
201
- 'label' => __('Excerpt Length', 'premium-addons-for-elementor'),
202
- 'type' => Controls_Manager::NUMBER,
203
- 'default' => 55,
204
- 'label_block' => true,
205
- 'condition' => [
206
- 'premium_blog_excerpt' => 'yes',
207
- ]
208
- ]
209
- );
210
-
211
- /*Excerpt Type*/
212
- $this->add_control('premium_blog_excerpt_type',
213
- [
214
- 'label' => __('Excerpt Type', 'premium-addons-for-elementor'),
215
- 'type' => Controls_Manager::SELECT,
216
- 'options' => [
217
- 'dots' => __('Dots', 'premium-addons-for-elementor'),
218
- 'link' => __('Link', 'premium-addons-for-elementor'),
219
- ],
220
- 'default' => 'dots',
221
- 'label_block' => true
222
]
223
- );
224
225
- /*Excerpt Text*/
226
$this->add_control('premium_blog_excerpt_text',
227
[
228
'label' => __( 'Link Text', 'premium-addons-for-elementor' ),
@@ -235,497 +246,523 @@ class Premium_Blog extends Widget_Base {
235
]
236
);
237
238
- /*Author Meta*/
239
$this->add_control('premium_blog_author_meta',
240
- [
241
- 'label' => __('Author Meta', 'premium-addons-for-elementor'),
242
- 'type' => Controls_Manager::SWITCHER,
243
- 'default' => 'yes',
244
- ]
245
- );
246
-
247
- /*Date Meta*/
248
$this->add_control('premium_blog_date_meta',
249
- [
250
- 'label' => __('Date Meta', 'premium-addons-for-elementor'),
251
- 'type' => Controls_Manager::SWITCHER,
252
- 'default' => 'yes',
253
- ]
254
- );
255
-
256
- /*Categories Meta*/
257
$this->add_control('premium_blog_categories_meta',
258
- [
259
- 'label' => __('Categories Meta', 'premium-addons-for-elementor'),
260
- 'type' => Controls_Manager::SWITCHER,
261
- 'description' => __('Display or hide categories mata','premium-addons-for-elementor'),
262
- 'default' => 'yes',
263
- ]
264
- );
265
-
266
- /*Comments Meta*/
267
$this->add_control('premium_blog_comments_meta',
268
- [
269
- 'label' => __('Comments Meta', 'premium-addons-for-elementor'),
270
- 'description' => __('Display or hide comments mata','premium-addons-for-elementor'),
271
- 'type' => Controls_Manager::SWITCHER,
272
- 'default' => 'yes',
273
- ]
274
- );
275
-
276
- /*Tags Meta*/
277
$this->add_control('premium_blog_tags_meta',
278
- [
279
- 'label' => __('Tags Meta', 'premium-addons-for-elementor'),
280
- 'type' => Controls_Manager::SWITCHER,
281
- 'description' => __('Display or hide post tags','premium-addons-for-elementor'),
282
- 'default' => 'yes',
283
- ]
284
- );
285
-
286
- /*Post Format Icon*/
287
$this->add_control('premium_blog_post_format_icon',
288
[
289
- 'label' => __( 'Post Format Icon', 'essential-addons-elementor' ),
290
- 'type' => Controls_Manager::SWITCHER,
291
- 'default' => 'yes',
292
]
293
);
294
295
- /*Edit Post Meta*/
296
$this->add_control('premium_blog_edit_post',
297
- [
298
- 'label' => __('Edit Post Icon', 'premium-addons-for-elementor'),
299
- 'type' => Controls_Manager::SWITCHER,
300
- 'description' => __('Display or hide edit post option','premium-addons-for-elementor'),
301
- 'default' => 'yes',
302
- ]
303
- );
304
-
305
- /*Pagination*/
306
$this->add_control('premium_blog_paging',
307
- [
308
- 'label' => __('Pagination', 'premium-addons-for-elementor'),
309
- 'type' => Controls_Manager::SWITCHER,
310
- 'description' => __('Pagination is the process of dividing the posts into discrete pages','premium-addons-for-elementor'),
311
- ]
312
- );
313
314
$this->add_control('premium_blog_new_tab',
315
- [
316
- 'label' => __('Links in New Tab', 'premium-addons-for-elementor'),
317
- 'type' => Controls_Manager::SWITCHER,
318
- 'description' => __('Enable links to be opened in a new tab','premium-addons-for-elementor'),
319
- 'default' => 'yes',
320
- ]
321
- );
322
323
- /*Number of Posts*/
324
$this->add_control('premium_blog_number_of_posts',
325
- [
326
- 'label' => __('Posts Per Page', 'premium-addons-for-elementor'),
327
- 'description' => __('Choose how many posts do you want to be displayed per page','premium-addons-for-elementor'),
328
- 'type' => Controls_Manager::NUMBER,
329
- 'min' => 1,
330
- 'default' => 1,
331
- ]
332
- );
333
-
334
- /*Posts Offset*/
335
$this->add_control('premium_blog_offset',
336
[
337
- 'label' => __( 'Offset Count', 'premium-addons-for-elementor' ),
338
'description' => __('The index of post to start with','premium-addons-for-elementor'),
339
- 'type' => Controls_Manager::NUMBER,
340
- 'default' => '0',
341
- 'min' => '0',
342
]
343
);
344
345
- /*Front Text Align*/
346
- $this->add_responsive_control('premium_flip_text_align',
347
- [
348
- 'label' => __( 'Alignment', 'premium-addons-for-elementor' ),
349
- 'type' => Controls_Manager::CHOOSE,
350
- 'options' => [
351
- 'left' => [
352
- 'title'=> __( 'Left', 'premium-addons-for-elementor' ),
353
- 'icon' => 'fa fa-align-left',
354
- ],
355
- 'center' => [
356
- 'title'=> __( 'Center', 'premium-addons-for-elementor' ),
357
- 'icon' => 'fa fa-align-center',
358
- ],
359
- 'right' => [
360
- 'title'=> __( 'Right', 'premium-addons-for-elementor' ),
361
- 'icon' => 'fa fa-align-right',
362
- ],
363
- ],
364
- 'default' => 'left',
365
- 'selectors' => [
366
- '{{WRAPPER}} .premium-blog-content-wrapper' => 'text-align: {{VALUE}};',
367
- ],
368
- ]
369
- );
370
-
371
-
372
- /*End Content Section*/
373
$this->end_controls_section();
374
375
- /*Start Color Style Section*/
376
$this->start_controls_section('premium_blog_image_style_section',
377
- [
378
- 'label' => __('Image', 'premium-addons-for-elementor'),
379
- 'tab' => Controls_Manager::TAB_STYLE,
380
- ]
381
- );
382
383
- /*Plus Icon Color*/
384
$this->add_control('premium_blog_plus_color',
385
- [
386
- 'label' => __('Icon Color', 'premium-addons-for-elementor'),
387
- 'type' => Controls_Manager::COLOR,
388
- 'scheme' => [
389
- 'type' => Scheme_Color::get_type(),
390
- 'value' => Scheme_Color::COLOR_2,
391
- ],
392
- 'selectors' => [
393
- '{{WRAPPER}} .premium-blog-thumbnail-container:before, {{WRAPPER}} .premium-blog-thumbnail-container:after' => 'background-color: {{VALUE}};',
394
- ]
395
- ]
396
- );
397
398
- /*Overlay Color*/
399
$this->add_control('premium_blog_overlay_color',
400
- [
401
- 'label' => __('Overlay Color', 'premium-addons-for-elementor'),
402
- 'type' => Controls_Manager::COLOR,
403
- 'scheme' => [
404
- 'type' => Scheme_Color::get_type(),
405
- 'value' => Scheme_Color::COLOR_1,
406
- ],
407
- 'selectors' => [
408
- '{{WRAPPER}} .premium-blog-framed-effect, {{WRAPPER}} .premium-blog-bordered-effect,{{WRAPPER}} .premium-blog-squares-effect:before,{{WRAPPER}} .premium-blog-squares-effect:after,{{WRAPPER}} .premium-blog-squares-square-container:before,{{WRAPPER}} .premium-blog-squares-square-container:after, {{WRAPPER}} .premium-blog-format-container:hover,{{WRAPPER}} .premium-blog-pagination-container .current' => 'background-color: {{VALUE}};',
409
- ]
410
- ]
411
- );
412
413
- /*Bordered Effect Border Color*/
414
$this->add_control('premium_blog_border_effect_color',
415
- [
416
- 'label' => __('Border Color', 'premium-addons-for-elementor'),
417
- 'type' => Controls_Manager::COLOR,
418
- 'scheme' => [
419
- 'type' => Scheme_Color::get_type(),
420
- 'value' => Scheme_Color::COLOR_2,
421
- ],
422
- 'description' => 'Used with Bordered style only',
423
- 'condition' => [
424
- 'premium_blog_hover_color_effect' => 'bordered',
425
- ],
426
- 'selectors' => [
427
- '{{WRAPPER}} .premium-blog-bordered-border-container' => 'border-color: {{VALUE}};',
428
- ],
429
- ]
430
- );
431
432
$this->end_controls_section();
433
434
$this->start_controls_section('premium_blog_title_style_section',
435
- [
436
- 'label' => __('Title', 'premium-addons-for-elementor'),
437
- 'tab' => Controls_Manager::TAB_STYLE,
438
- ]
439
- );
440
441
- /*Titles Color*/
442
$this->add_control('premium_blog_title_color',
443
- [
444
- 'label' => __('Color', 'premium-addons-for-elementor'),
445
- 'type' => Controls_Manager::COLOR,
446
- 'scheme' => [
447
- 'type' => Scheme_Color::get_type(),
448
- 'value' => Scheme_Color::COLOR_2,
449
- ],
450
- 'selectors' => [
451
- '{{WRAPPER}} .premium-blog-entry-title a' => 'color: {{VALUE}};',
452
- ]
453
- ]
454
- );
455
456
$this->add_group_control(
457
Group_Control_Typography::get_type(),
458
- [
459
- 'name' => 'premium_blog_title_typo',
460
- 'scheme' => Scheme_Typography::TYPOGRAPHY_1,
461
- 'selector' => '{{WRAPPER}} .premium-blog-entry-title',
462
- ]
463
- );
464
-
465
- /*Titles Hover Color*/
466
$this->add_control('premium_blog_title_hover_color',
467
- [
468
- 'label' => __('Hover Color', 'premium-addons-for-elementor'),
469
- 'type' => Controls_Manager::COLOR,
470
- 'scheme' => [
471
- 'type' => Scheme_Color::get_type(),
472
- 'value' => Scheme_Color::COLOR_1,
473
- ],
474
- 'selectors' => [
475
- '{{WRAPPER}} .premium-blog-entry-title:hover a' => 'color: {{VALUE}};',
476
- ]
477
- ]
478
- );
479
480
$this->end_controls_section();
481
482
$this->start_controls_section('premium_blog_meta_style_section',
483
- [
484
- 'label' => __('Meta', 'premium-addons-for-elementor'),
485
- 'tab' => Controls_Manager::TAB_STYLE,
486
- ]
487
- );
488
489
- /*Meta Color*/
490
$this->add_control('premium_blog_meta_color',
491
- [
492
- 'label' => __('Color', 'premium-addons-for-elementor'),
493
- 'type' => Controls_Manager::COLOR,
494
- 'scheme' => [
495
- 'type' => Scheme_Color::get_type(),
496
- 'value' => Scheme_Color::COLOR_2,
497
- ],
498
- 'selectors' => [
499
- '{{WRAPPER}} .premium-blog-entry-meta, {{WRAPPER}} .premium-blog-entry-meta a, {{WRAPPER}} .premium-blog-post-content .premium-blog-excerpt-link' => 'color: {{VALUE}};',
500
- ]
501
- ]
502
- );
503
504
505
$this->add_group_control(
506
Group_Control_Typography::get_type(),
507
- [
508
- 'name' => 'premium_blog_meta_typo',
509
- 'scheme' => Scheme_Typography::TYPOGRAPHY_1,
510
- 'selector' => '{{WRAPPER}} .premium-blog-entry-meta a,{{WRAPPER}} .premium-blog-post-content .premium-blog-excerpt-link',
511
- ]
512
- );
513
-
514
- /*Meta Hover Color*/
515
$this->add_control('premium_blog_meta_hover_color',
516
- [
517
- 'label' => __('Hover Color', 'premium-addons-for-elementor'),
518
- 'type' => Controls_Manager::COLOR,
519
- 'scheme' => [
520
- 'type' => Scheme_Color::get_type(),
521
- 'value' => Scheme_Color::COLOR_1,
522
- ],
523
- 'selectors' => [
524
- '{{WRAPPER}} .premium-blog-entry-meta a:hover, {{WRAPPER}} .premium-blog-post-content .premium-blog-excerpt-link:hover' => 'color: {{VALUE}};',
525
- ]
526
- ]
527
- );
528
529
$this->end_controls_section();
530
531
$this->start_controls_section('premium_blog_content_style_section',
532
- [
533
- 'label' => __('Content', 'premium-addons-for-elementor'),
534
- 'tab' => Controls_Manager::TAB_STYLE,
535
- ]
536
- );
537
538
- /*Post Content Color*/
539
$this->add_control('premium_blog_post_content_color',
540
- [
541
- 'label' => __('Color', 'premium-addons-for-elementor'),
542
- 'type' => Controls_Manager::COLOR,
543
- 'scheme' => [
544
- 'type' => Scheme_Color::get_type(),
545
- 'value' => Scheme_Color::COLOR_3,
546
- ],
547
- 'selectors' => [
548
- '{{WRAPPER}} .premium-blog-post-content' => 'color: {{VALUE}};',
549
- ]
550
- ]
551
- );
552
-
553
- /*Post Content Typography*/
554
$this->add_group_control(
555
Group_Control_Typography::get_type(),
556
- [
557
- 'name' => 'premium_blog_content_typo',
558
- 'scheme' => Scheme_Typography::TYPOGRAPHY_1,
559
- 'selector' => '{{WRAPPER}} .premium-blog-post-content',
560
- ]
561
- );
562
-
563
564
- /*Content Background Color*/
565
$this->add_control('premium_blog_content_background_color',
566
- [
567
- 'label' => __('Background Color', 'premium-addons-for-elementor'),
568
- 'type' => Controls_Manager::COLOR,
569
- 'default' => '#f5f5f5',
570
- 'selectors' => [
571
- '{{WRAPPER}} .premium-blog-content-wrapper' => 'background-color: {{VALUE}};',
572
- ]
573
- ]
574
- );
575
-
576
$this->end_controls_section();
577
578
$this->start_controls_section('premium_blog_tags_style_section',
579
- [
580
- 'label' => __('Tags', 'premium-addons-for-elementor'),
581
- 'tab' => Controls_Manager::TAB_STYLE,
582
- ]
583
- );
584
585
- /*Tags Color*/
586
$this->add_control('premium_blog_tags_color',
587
- [
588
- 'label' => __('Color', 'premium-addons-for-elementor'),
589
- 'type' => Controls_Manager::COLOR,
590
- 'scheme' => [
591
- 'type' => Scheme_Color::get_type(),
592
- 'value' => Scheme_Color::COLOR_2,
593
- ],
594
- 'selectors' => [
595
- '{{WRAPPER}} .premium-blog-post-tags-container, {{WRAPPER}} .premium-blog-post-tags-container a' => 'color: {{VALUE}};',
596
- ]
597
- ]
598
- );
599
600
- /*Tags Typography*/
601
$this->add_group_control(
602
Group_Control_Typography::get_type(),
603
- [
604
- 'name' => 'premium_blog_tags_typo',
605
- 'scheme' => Scheme_Typography::TYPOGRAPHY_1,
606
- 'selector' => '{{WRAPPER}} .premium-blog-post-tags-container a',
607
- ]
608
- );
609
-
610
- /*Tags Hover Color*/
611
$this->add_control('premium_blog_tags_hoer_color',
612
- [
613
- 'label' => __('Hover Color', 'premium-addons-for-elementor'),
614
- 'type' => Controls_Manager::COLOR,
615
- 'scheme' => [
616
- 'type' => Scheme_Color::get_type(),
617
- 'value' => Scheme_Color::COLOR_1,
618
- ],
619
- 'selectors' => [
620
- '{{WRAPPER}} .premium-blog-post-tags-container a:hover' => 'color: {{VALUE}};',
621
- ]
622
- ]
623
- );
624
625
$this->end_controls_section();
626
627
- /*Post Format Icon*/
628
$this->start_controls_section('premium_blog_format_style_section',
629
- [
630
- 'label' => __('Post Format Icon', 'premium-addons-for-elementor'),
631
- 'tab' => Controls_Manager::TAB_STYLE,
632
- 'condition' => [
633
- 'premium_blog_post_format_icon' => 'yes'
634
- ]
635
- ]
636
- );
637
638
$this->add_control('premium_blog_format_icon_size',
639
- [
640
- 'label' => __('Size', 'premium-addons-for-elementor'),
641
- 'type' => Controls_Manager::SLIDER,
642
- 'description' => __('Choose icon size in (PX, EM)', 'premium-addons-for-elementor'),
643
- 'range' => [
644
- 'em' => [
645
- 'min' => 1,
646
- 'max' => 10,
647
- ],
648
- ],
649
- 'size_units' => ['px', "em"],
650
- 'label_block' => true,
651
- 'selectors' => [
652
- '{{WRAPPER}} .premium-blog-format-icon' => 'font-size: {{SIZE}}{{UNIT}};',
653
- ]
654
- ]
655
- );
656
-
657
- /*Post Format Icon Color*/
658
- $this->add_control('premium_blog_format_icon_color',
659
- [
660
- 'label' => __('Color', 'premium-addons-for-elementor'),
661
- 'type' => Controls_Manager::COLOR,
662
- 'scheme' => [
663
- 'type' => Scheme_Color::get_type(),
664
- 'value' => Scheme_Color::COLOR_2,
665
],
666
- 'selectors' => [
667
- '{{WRAPPER}} .premium-blog-format-container i' => 'color: {{VALUE}};',
668
- ]
669
- ]
670
- );
671
672
- /*Post Format Icon Color*/
673
$this->add_control('premium_blog_format_icon_hover_color',
674
- [
675
- 'label' => __('Hover Color', 'premium-addons-for-elementor'),
676
- 'type' => Controls_Manager::COLOR,
677
- 'scheme' => [
678
- 'type' => Scheme_Color::get_type(),
679
- 'value' => Scheme_Color::COLOR_1,
680
- ],
681
- 'selectors' => [
682
- '{{WRAPPER}} .premium-blog-format-container:hover i' => 'color: {{VALUE}};',
683
- ]
684
- ]
685
- );
686
687
- /*Post Format Background Color*/
688
$this->add_control('premium_blog_format_back_color',
689
- [
690
- 'label' => __('Background Color', 'premium-addons-for-elementor'),
691
- 'type' => Controls_Manager::COLOR,
692
- 'scheme' => [
693
- 'type' => Scheme_Color::get_type(),
694
- 'value' => Scheme_Color::COLOR_1,
695
- ],
696
- 'selectors' => [
697
- '{{WRAPPER}} .premium-blog-format-container' => 'background-color: {{VALUE}};',
698
- ]
699
- ]
700
- );
701
702
- /*Post Format Hover Background Color*/
703
$this->add_control('premium_blog_format_back_hover_color',
704
- [
705
- 'label' => __('Hover Background Color', 'premium-addons-for-elementor'),
706
- 'type' => Controls_Manager::COLOR,
707
- 'scheme' => [
708
- 'type' => Scheme_Color::get_type(),
709
- 'value' => Scheme_Color::COLOR_2,
710
- ],
711
- 'selectors' => [
712
- '{{WRAPPER}} .premium-blog-format-container:hover' => 'background-color: {{VALUE}};',
713
- ]
714
- ]
715
- );
716
717
- /*End Format Icon Style Section*/
718
$this->end_controls_section();
719
720
- /*Pagination Style*/
721
$this->start_controls_section('premium_blog_pagination_Style',
722
[
723
'label' => __('Pagination Style', 'premium-addons-for-elementor'),
724
- 'tab' => Controls_Manager::TAB_STYLE,
725
'condition' => [
726
'premium_blog_paging' => 'yes',
727
]
728
- ]);
729
730
$this->start_controls_tabs('premium_blog_pagination_colors');
731
@@ -733,7 +770,8 @@ class Premium_Blog extends Widget_Base {
733
[
734
'label' => __('Normal', 'premium-addons-for-elementor'),
735
736
- ]);
737
738
$this->add_control('prmeium_blog_pagination_color',
739
[
@@ -746,7 +784,8 @@ class Premium_Blog extends Widget_Base {
746
'selectors' => [
747
'{{WRAPPER}} .premium-blog-pagination-container li a, {{WRAPPER}} .premium-blog-pagination-container li span' => 'color: {{VALUE}};'
748
]
749
- ]);
750
751
$this->add_control('prmeium_blog_pagination_back_color',
752
[
@@ -759,7 +798,8 @@ class Premium_Blog extends Widget_Base {
759
'selectors' => [
760
'{{WRAPPER}} .premium-blog-pagination-container li a, {{WRAPPER}} .premium-blog-pagination-container li span' => 'background-color: {{VALUE}};'
761
]
762
- ]);
763
764
$this->end_controls_tab();
765
@@ -767,7 +807,8 @@ class Premium_Blog extends Widget_Base {
767
[
768
'label' => __('Hover', 'premium-addons-for-elementor'),
769
770
- ]);
771
772
$this->add_control('prmeium_blog_pagination_hover_color',
773
[
@@ -780,7 +821,8 @@ class Premium_Blog extends Widget_Base {
780
'selectors' => [
781
'{{WRAPPER}} .premium-blog-pagination-container li:hover a, {{WRAPPER}} .premium-blog-pagination-container li:hover span' => 'color: {{VALUE}};'
782
]
783
- ]);
784
785
$this->add_control('prmeium_blog_pagination_back_hover_color',
786
[
@@ -793,87 +835,165 @@ class Premium_Blog extends Widget_Base {
793
'selectors' => [
794
'{{WRAPPER}} .premium-blog-pagination-container li:hover a, {{WRAPPER}} .premium-blog-pagination-container li:hover span' => 'background-color: {{VALUE}};'
795
]
796
- ]);
797
798
$this->end_controls_tab();
799
800
$this->end_controls_tabs();
801
802
- /*End Paging Style Section*/
803
$this->end_controls_section();
804
805
}
806
807
- protected function get_blog_responsive_style() {
808
-
809
- $breakpoints = Responsive::get_breakpoints();
810
-
811
- $style = '<style>';
812
- $style .= '@media ( max-width: ' . $breakpoints['lg'] . 'px ) {';
813
- $style .= '.premium-blog-entry-title {';
814
- $style .= 'line-height: 1;';
815
- $style .= '}';
816
- $style .= '.premium-blog-entry-title a {';
817
- $style .= 'font-size: 18px;';
818
- $style .= '}';
819
- $style .= '}';
820
- $style .= '@media ( max-width: ' . $breakpoints['md'] . 'px ) {';
821
- $style .= '.premium-blog-post-container {';
822
- $style .= 'width: 100% !important;';
823
- $style .= '}';
824
- $style .= '.premium-blog-content-wrapper {';
825
- $style .= 'padding: 15px;';
826
- $style .= '}';
827
- $style .= '.premium-blog-entry-title {';
828
- $style .= 'line-height: 1;';
829
- $style .= '}';
830
- $style .= '.premium-blog-entry-title a {';
831
- $style .= 'font-size: 16px;';
832
- $style .= '}';
833
- $style .= '}';
834
- $style .= '</style>';
835
-
836
- return $style;
837
838
}
839
840
- protected function render() {
841
842
- if ( get_query_var('paged') ) {
843
- $paged = get_query_var('paged');
844
- } elseif ( get_query_var('page') ) {
845
- $paged = get_query_var('page');
846
- } else {
847
- $paged = 1;
848
}
849
850
- // get our input from the widget settings.
851
$settings = $this->get_settings();
852
853
- if($settings['premium_blog_new_tab'] == 'yes'){
854
$target = '_blank';
855
} else {
856
$target = '_self';
857
}
858
859
- $image_effect = $settings['premium_blog_hover_image_effect'];
860
861
- $post_effect = $settings['premium_blog_hover_color_effect'];
862
863
$offset = $settings['premium_blog_offset'];
864
865
$post_per_page = $settings['premium_blog_number_of_posts'];
866
867
$new_offset = $offset + ( ( $paged - 1 ) * $post_per_page );
868
869
- $post_args = premium_blog_get_post_settings($settings);
870
871
- $posts = premium_blog_get_post_data($post_args, $paged , $new_offset);
872
873
- $excerpt_type = $settings['premium_blog_excerpt_type'];
874
- $excerpt_text = $settings['premium_blog_excerpt_text'];
875
- $date_format = get_option('date_format');
876
- switch($settings['premium_blog_columns_number']){
877
case '50%' :
878
$col_number = 'col-2';
879
break;
@@ -885,108 +1005,48 @@ class Premium_Blog extends Widget_Base {
885
break;
886
}
887
888
?>
889
- <div class="premium-blog-wrap <?php echo esc_attr($col_number); ?>" data-pa-masonry="<?php echo esc_attr($settings['premium_blog_masonry']); ?>">
890
<?php
891
- if( count( $posts ) ){
892
global $post;
893
- foreach($posts as $post){
894
setup_postdata($post);
895
- ?>
896
- <div class="premium-blog-post-container">
897
- <div class="premium-blog-thumb-effect-wrapper">
898
- <div class="premium-blog-thumbnail-container <?php echo 'premium-blog-' . $image_effect . '-effect';?>">
899
- <a href="<?php the_permalink(); ?>" target="<?php echo esc_attr($target); ?>"><?php the_post_thumbnail('full'); ?></a>
900
- </div>
901
- <div class="premium-blog-effect-container <?php echo 'premium-blog-'. $post_effect . '-effect'; ?>">
902
- <a class="premium-blog-post-link" href="<?php the_permalink(); ?>" target="<?php echo esc_attr($target); ?>"></a>
903
- <?php if( $settings['premium_blog_hover_color_effect'] === 'bordered' ) : ?>
904
- <div class="premium-blog-bordered-border-container"></div>
905
- <?php elseif( $settings['premium_blog_hover_color_effect'] === 'squares' ) : ?>
906
- <div class="premium-blog-squares-square-container"></div>
907
- <?php endif; ?>
908
- </div>
909
- </div>
910
- <div class="premium-blog-content-wrapper <?php echo (!has_post_thumbnail()) ? 'empty-thumb' : ''; ?>">
911
- <div class="premium-blog-inner-container">
912
- <?php if( $settings['premium_blog_post_format_icon'] === 'yes' ) : ?>
913
- <div class="premium-blog-format-container">
914
- <a class="premium-blog-format-link" href="<?php the_permalink(); ?>" title="<?php if( get_post_format() === ' ') : echo 'standard' ; else : echo get_post_format(); endif; ?>" target="<?php echo esc_attr($target); ?>"><i class="premium-blog-format-icon fa fa-<?php if ( get_post_format() === 'aside' ) : echo 'file-text-o'; ?>
915
- <?php elseif ( get_post_format() === 'audio' ) : echo 'music'; ?>
916
- <?php elseif ( get_post_format() === 'gallery' ) : echo 'file-image-o'; ?>
917
- <?php elseif ( get_post_format() === 'image' ) : echo 'picture-o'; ?>
918
- <?php elseif ( get_post_format() === 'link' ) : echo 'link'; ?>
919
- <?php elseif ( get_post_format() === 'quote' ) :echo 'quote-left'; ?>
920
- <?php elseif ( get_post_format() === 'video' ) : echo 'video-camera'; ?>
921
- <?php else : echo 'thumb-tack'; ?>
922
- <?php endif; ?>"></i></a>
923
- </div>
924
- <?php endif; ?>
925
- <div class="premium-blog-entry-container">
926
- <<?php echo $settings['premium_blog_title_tag']; ?> class="premium-blog-entry-title"><a href="<?php the_permalink(); ?>" target="<?php echo esc_attr($target); ?>"><?php the_title(); ?></a></<?php echo $settings['premium_blog_title_tag']; ?>>
927
- <div class="premium-blog-entry-meta" style="<?php if( $settings['premium_blog_post_format_icon'] !== 'yes' ) : echo 'margin-left:0px'; endif; ?>">
928
- <?php if( $settings['premium_blog_author_meta'] === 'yes' ) : ?>
929
- <span class="premium-blog-post-author premium-blog-meta-data"><i class="fa fa-user fa-fw"></i><?php the_author_posts_link();?></span>
930
- <?php endif; ?>
931
- <?php if( $settings['premium_blog_date_meta'] === 'yes' ) : ?>
932
- <span class="premium-blog-post-time premium-blog-meta-data"><i class="fa fa-calendar fa-fw"></i><a href="<?php the_permalink(); ?>" target="<?php echo esc_attr($target); ?>"><?php the_time($date_format); ?></a></span>
933
- <?php endif; ?>
934
- <?php if( $settings['premium_blog_categories_meta'] === 'yes' ) : ?>
935
- <span class="premium-blog-post-categories premium-blog-meta-data"><i class="fa fa-align-left fa-fw"></i><?php the_category(', '); ?></span>
936
- <?php endif; ?>
937
- <?php if( $settings['premium_blog_comments_meta'] === 'yes' ) : ?>
938
- <span class="premium-blog-post-comments premium-blog-meta-data"><i class="fa fa-comments-o fa-fw"></i><a href="<?php the_permalink(); ?>" target="<?php echo esc_attr($target); ?>"><?php comments_number('0 Comments', '1', '%'); ?> </a></span>
939
- <?php endif; ?>
940
- <?php if( $settings['premium_blog_edit_post'] === 'yes' ) : ?>
941
- <span class="premium-blog-post-edit premium-blog-meta-data"><i class="fa fa-pencil fa-fw"></i><?php edit_post_link(); ?></span>
942
- <?php endif; ?>
943
- </div>
944
- </div>
945
- </div>
946
- <div class="premium-blog-post-content" style="<?php if ( $settings['premium_blog_post_format_icon'] !== 'yes' ) : echo 'margin-left:0px;'; endif; ?>">
947
- <?php
948
- if ( $settings['premium_blog_excerpt'] === 'yes' ) :
949
- echo premium_addons_get_excerpt_by_id(get_the_ID(),$settings['premium_blog_excerpt_length'],$excerpt_type,$excerpt_text);
950
- else: the_content();
951
- endif; ?>
952
- </div>
953
- <div class="premium-blog-post-tags-container" style="<?php if( $settings['premium_blog_post_format_icon'] !== 'yes' ) : echo 'margin-left:0px;'; endif; ?>">
954
- <?php if( $settings['premium_blog_tags_meta'] === 'yes' && the_tags() != '' ) : ?>
955
- <span class="premium-blog-post-tags"><i class="fa fa-tags fa-fw"></i><?php the_tags(' ', ', '); ?> </span>
956
- <?php endif; ?>
957
- </div>
958
- </div>
959
- </div>
960
- <?php }?>
961
- <div class="premium-blog-clear-fix"></div>
962
- </div>
963
<?php if ( $settings['premium_blog_paging'] === 'yes' ) : ?>
964
<div class="premium-blog-pagination-container">
965
- <?php
966
- $count_posts = wp_count_posts();
967
- $published_posts = $count_posts->publish;
968
969
- $page_tot = ceil( ( $published_posts - $offset ) / $settings['premium_blog_number_of_posts'] );
970
- if ( $page_tot > 1 ) {
971
- $big = 999999999;
972
- echo paginate_links( array(
973
- 'base' => str_replace( $big, '%#%',get_pagenum_link( 999999999, false ) ),
974
- 'format' => '?paged=%#%',
975
- 'current' => max( 1, $paged ),
976
- 'total' => $page_tot,
977
- 'prev_next' => true,
978
- 'prev_text' => sprintf( "&lsaquo; %s", __("Previous","premium-addons-for-elementor") ),
979
- 'next_text' => sprintf( "%s &rsaquo;", __("Next","premium-addons-for-elementor") ),
980
- 'end_size' => 1,
981
- 'mid_size' => 2,
982
- 'type' => 'list'
983
- ));
984
- }
985
- ?>
986
</div>
987
- <?php
988
- endif;
989
- echo $this->get_blog_responsive_style();
990
wp_reset_postdata();
991
}
992
}
33
return [ 'premium-elements' ];
34
}
35
36
+ // Adding the controls fields for Premium Blog
37
// This will controls the animation, colors and background, dimensions etc
38
protected function _register_controls() {
39
40
$this->start_controls_section('premium_blog_general_settings',
41
+ [
42
+ 'label' => __('Image', 'premium-addons-for-elementor'),
43
+ ]
44
+ );
45
46
$this->add_control('premium_blog_hover_image_effect',
47
+ [
48
+ 'label' => __('Hover Effect', 'premium-addons-for-elementor'),
49
+ 'type' => Controls_Manager::SELECT,
50
+ 'description' => __('Choose a hover effect for the image','premium-addons-for-elementor'),
51
+ 'options' => [
52
+ 'none' => __('None', 'premium-addons-for-elementor'),
53
+ 'zoomin' => __('Zoom In', 'premium-addons-for-elementor'),
54
+ 'zoomout'=> __('Zoom Out', 'premium-addons-for-elementor'),
55
+ 'scale' => __('Scale', 'premium-addons-for-elementor'),
56
+ 'gray' => __('Grayscale', 'premium-addons-for-elementor'),
57
+ 'blur' => __('Blur', 'premium-addons-for-elementor'),
58
+ 'bright' => __('Bright', 'premium-addons-for-elementor'),
59
+ 'sepia' => __('Sepia', 'premium-addons-for-elementor'),
60
+ 'trans' => __('Translate', 'premium-addons-for-elementor'),
61
+ ],
62
+ 'default' => 'zoomin',
63
+ 'label_block' => true
64
+ ]
65
+ );
66
67
$this->add_control('premium_blog_hover_color_effect',
68
+ [
69
+ 'label' => __('Color Effect', 'premium-addons-for-elementor'),
70
+ 'type' => Controls_Manager::SELECT,
71
+ 'description' => __('Choose an overlay color effect','premium-addons-for-elementor'),
72
+ 'options' => [
73
+ 'none' => __('None', 'premium-addons-for-elementor'),
74
+ 'framed' => __('Framed', 'premium-addons-for-elementor'),
75
+ 'diagonal' => __('Diagonal', 'premium-addons-for-elementor'),
76
+ 'bordered' => __('Bordered', 'premium-addons-for-elementor'),
77
+ 'squares' => __('Squares', 'premium-addons-for-elementor'),
78
+ ],
79
+ 'default' => 'framed',
80
+ 'label_block' => true
81
+ ]
82
+ );
83
84
$this->end_controls_section();
85
86
$this->start_controls_section('premium_blog_content_settings',
87
[
88
+ 'label' => __('Display Options', 'premium-addons-for-elementor'),
89
]
90
);
91
96
'type' => Controls_Manager::SELECT,
97
'default' => 'h2',
98
'options' => [
99
+ 'h1' => 'H1',
100
+ 'h2' => 'H2',
101
+ 'h3' => 'H3',
102
+ 'h4' => 'H4',
103
+ 'h5' => 'H5',
104
+ 'h6' => 'H6',
105
+ ],
106
'label_block' => true,
107
]
108
);
109
110
$this->add_control('premium_blog_grid',
111
+ [
112
+ 'label' => __('Grid', 'premium-addons-for-elementor'),
113
+ 'type' => Controls_Manager::SWITCHER,
114
+ 'default' => 'yes'
115
+ ]
116
+ );
117
118
$this->add_control('premium_blog_masonry',
119
+ [
120
+ 'label' => __('Masonry', 'premium-addons-for-elementor'),
121
+ 'type' => Controls_Manager::SWITCHER,
122
+ 'return_value' => 'true',
123
+ 'default' => 'true',
124
+ 'condition' => [
125
+ 'premium_blog_grid' => 'yes'
126
+ ]
127
+ ]
128
+ );
129
+
130
+ $this->add_responsive_control('premium_blog_columns_number',
131
+ [
132
+ 'label' => __('Number of Columns', 'premium-addons-for-elementor'),
133
+ 'type' => Controls_Manager::SELECT,
134
+ 'options' => [
135
+ '100%' => __('1 Column', 'premium-addons-for-elementor'),
136
+ '50%' => __('2 Columns', 'premium-addons-for-elementor'),
137
+ '33.33%'=> __('3 Columns', 'premium-addons-for-elementor'),
138
+ '25%' => __('4 Columns', 'premium-addons-for-elementor'),
139
+ ],
140
+ 'default' => '33.33%',
141
+ 'selectors' => [
142
+ '{{WRAPPER}} .premium-blog-post-container' => 'width: {{VALUE}};'
143
+ ],
144
+ 'condition' => [
145
+ 'premium_blog_grid' => 'yes',
146
+ ],
147
+ 'label_block' => true
148
+ ]
149
+ );
150
151
$this->add_responsive_control('premium_blog_posts_spacing',
152
+ [
153
+ 'label' => __('Spacing', 'premium-addons-for-elementor'),
154
+ 'type' => Controls_Manager::SLIDER,
155
+ 'size_units' => ['px', '%', "em"],
156
+ 'range' => [
157
+ 'px' => [
158
+ 'min' => 1,
159
+ 'max' => 200,
160
],
161
+ ],
162
+ 'condition' => [
163
+ 'premium_blog_grid' => 'yes'
164
+ ],
165
+ 'selectors' => [
166
+ '{{WRAPPER}} .premium-blog-post-container' => 'padding: {{SIZE}}{{UNIT}};'
167
+ ]
168
+ ]
169
+ );
170
+
171
+ $this->add_responsive_control('premium_flip_text_align',
172
+ [
173
+ 'label' => __( 'Alignment', 'premium-addons-for-elementor' ),
174
+ 'type' => Controls_Manager::CHOOSE,
175
+ 'options' => [
176
+ 'left' => [
177
+ 'title'=> __( 'Left', 'premium-addons-for-elementor' ),
178
+ 'icon' => 'fa fa-align-left',
179
+ ],
180
+ 'center' => [
181
+ 'title'=> __( 'Center', 'premium-addons-for-elementor' ),
182
+ 'icon' => 'fa fa-align-center',
183
+ ],
184
+ 'right' => [
185
+ 'title'=> __( 'Right', 'premium-addons-for-elementor' ),
186
+ 'icon' => 'fa fa-align-right',
187
+ ],
188
+ ],
189
+ 'default' => 'left',
190
+ 'selectors' => [
191
+ '{{WRAPPER}} .premium-blog-content-wrapper' => 'text-align: {{VALUE}};',
192
+ ],
193
+ ]
194
+ );
195
+
196
+ $this->end_controls_section();
197
+
198
+ $this->start_controls_section('premium_blog_posts_options',
199
+ [
200
+ 'label' => __('Post Options', 'premium-addons-for-elementor'),
201
+ ]
202
+ );
203
204
$this->add_control('premium_blog_excerpt',
205
+ [
206
+ 'label' => __('Excerpt', 'premium-addons-for-elementor'),
207
+ 'type' => Controls_Manager::SWITCHER,
208
+ 'description' => __('Excerpt is used for article summary with a link to the whole entry. The default except length is 55','premium-addons-for-elementor'),
209
+ 'default' => 'yes',
210
+ ]
211
+ );
212
213
$this->add_control('premium_blog_excerpt_length',
214
+ [
215
+ 'label' => __('Excerpt Length', 'premium-addons-for-elementor'),
216
+ 'type' => Controls_Manager::NUMBER,
217
+ 'default' => 55,
218
+ 'condition' => [
219
+ 'premium_blog_excerpt' => 'yes',
220
]
221
+ ]
222
+ );
223
224
+ $this->add_control('premium_blog_excerpt_type',
225
+ [
226
+ 'label' => __('Excerpt Type', 'premium-addons-for-elementor'),
227
+ 'type' => Controls_Manager::SELECT,
228
+ 'options' => [
229
+ 'dots' => __('Dots', 'premium-addons-for-elementor'),
230
+ 'link' => __('Link', 'premium-addons-for-elementor'),
231
+ ],
232
+ 'default' => 'dots',
233
+ 'label_block' => true
234
+ ]
235
+ );
236
+
237
$this->add_control('premium_blog_excerpt_text',
238
[
239
'label' => __( 'Link Text', 'premium-addons-for-elementor' ),
246
]
247
);
248
249
$this->add_control('premium_blog_author_meta',
250
+ [
251
+ 'label' => __('Author Meta', 'premium-addons-for-elementor'),
252
+ 'type' => Controls_Manager::SWITCHER,
253
+ 'default' => 'yes',
254
+ ]
255
+ );
256
+
257
$this->add_control('premium_blog_date_meta',
258
+ [
259
+ 'label' => __('Date Meta', 'premium-addons-for-elementor'),
260
+ 'type' => Controls_Manager::SWITCHER,
261
+ 'default' => 'yes',
262
+ ]
263
+ );
264
+
265
$this->add_control('premium_blog_categories_meta',
266
+ [
267
+ 'label' => __('Categories Meta', 'premium-addons-for-elementor'),
268
+ 'type' => Controls_Manager::SWITCHER,
269
+ 'description' => __('Display or hide categories mata','premium-addons-for-elementor'),
270
+ 'default' => 'yes',
271
+ ]
272
+ );
273
+
274
$this->add_control('premium_blog_comments_meta',
275
+ [
276
+ 'label' => __('Comments Meta', 'premium-addons-for-elementor'),
277
+ 'description' => __('Display or hide comments mata','premium-addons-for-elementor'),
278
+ 'type' => Controls_Manager::SWITCHER,
279
+ 'default' => 'yes',
280
+ ]
281
+ );
282
+
283
$this->add_control('premium_blog_tags_meta',
284
+ [
285
+ 'label' => __('Tags Meta', 'premium-addons-for-elementor'),
286
+ 'type' => Controls_Manager::SWITCHER,
287
+ 'description' => __('Display or hide post tags','premium-addons-for-elementor'),
288
+ 'default' => 'yes',
289
+ ]
290
+ );
291
+
292
$this->add_control('premium_blog_post_format_icon',
293
[
294
+ 'label' => __( 'Post Format Icon', 'premium-addons-for-elementor' ),
295
+ 'type' => Controls_Manager::SWITCHER,
296
+ 'default' => 'yes',
297
]
298
);
299
300
$this->add_control('premium_blog_edit_post',
301
+ [
302
+ 'label' => __('Edit Post Icon', 'premium-addons-for-elementor'),
303
+ 'type' => Controls_Manager::SWITCHER,
304
+ 'description' => __('Display or hide edit post option','premium-addons-for-elementor'),
305
+ 'default' => 'yes',
306
+ ]
307
+ );
308
+
309
+ $this->end_controls_section();
310
+
311
+ $this->start_controls_section('premium_blog_advanced_settings',
312
+ [
313
+ 'label' => __('Advanced Settings', 'premium-addons-for-elementor'),
314
+ ]
315
+ );
316
+
317
+ $this->add_control('premium_blog_categories',
318
+ [
319
+ 'label' => __( 'Filter By Category', 'premium-addons-for-elementor' ),
320
+ 'type' => Controls_Manager::SELECT2,
321
+ 'description' => __('Get posts for specific category(s)','premium-addons-for-elementor'),
322
+ 'label_block' => true,
323
+ 'multiple' => true,
324
+ 'options' => premium_addons_post_type_categories(),
325
+ ]
326
+ );
327
+
328
+ $this->add_control('premium_blog_tags',
329
+ [
330
+ 'label' => __( 'Filter By Tag', 'premium-addons-for-elementor' ),
331
+ 'type' => Controls_Manager::SELECT2,
332
+ 'description' => __('Get posts for specific tag(s)','premium-addons-for-elementor'),
333
+ 'label_block' => true,
334
+ 'multiple' => true,
335
+ 'options' => premium_addons_post_type_tags(),
336
+ ]
337
+ );
338
+
339
+ $this->add_control('premium_blog_users',
340
+ [
341
+ 'label' => __( 'Filter By Author', 'premium-addons-for-elementor' ),
342
+ 'type' => Controls_Manager::SELECT2,
343
+ 'description' => __('Get posts for specific author(s)','premium-addons-for-elementor'),
344
+ 'label_block' => true,
345
+ 'multiple' => true,
346
+ 'options' => premium_addons_post_type_users(),
347
+ ]
348
+ );
349
+
350
+ $this->add_control('premium_blog_posts_exclude',
351
+ [
352
+ 'label' => __( 'Posts to Exclude', 'premium-addons-for-elementor' ),
353
+ 'type' => Controls_Manager::SELECT2,
354
+ 'description' => __('Add post(s) to exclude','premium-addons-for-elementor'),
355
+ 'label_block' => true,
356
+ 'multiple' => true,
357
+ 'options' => premium_addons_posts_list(),
358
+ ]
359
+ );
360
+
361
+ $this->add_control('premium_blog_order_by',
362
+ [
363
+ 'label' => __( 'Order By', 'premium-addons-for-elementor' ),
364
+ 'type' => Controls_Manager::SELECT,
365
+ 'label_block' => true,
366
+ 'options' => [
367
+ 'none' => __('None', 'premium-addons-for-elementor'),
368
+ 'ID' => __('ID', 'premium-addons-for-elementor'),
369
+ 'author'=> __('Author', 'premium-addons-for-elementor'),
370
+ 'title' => __('Title', 'premium-addons-for-elementor'),
371
+ 'name' => __('Name', 'premium-addons-for-elementor'),
372
+ 'date' => __('Date', 'premium-addons-for-elementor'),
373
+ 'modified'=> __('Last Modified', 'premium-addons-for-elementor'),
374
+ 'rand' => __('Random', 'premium-addons-for-elementor'),
375
+ 'comment_count'=> __('Number of Comments', 'premium-addons-for-elementor'),
376
+ ],
377
+ 'default' => 'date'
378
+ ]
379
+ );
380
+
381
+ $this->add_control('premium_blog_order',
382
+ [
383
+ 'label' => __( 'Order', 'premium-addons-for-elementor' ),
384
+ 'type' => Controls_Manager::SELECT,
385
+ 'label_block' => true,
386
+ 'options' => [
387
+ 'DESC' => __('Descending', 'premium-addons-for-elementor'),
388
+ 'ASC' => __('Ascending', 'premium-addons-for-elementor'),
389
+ ],
390
+ 'default' => 'DESC'
391
+ ]
392
+ );
393
+
394
$this->add_control('premium_blog_paging',
395
+ [
396
+ 'label' => __('Pagination', 'premium-addons-for-elementor'),
397
+ 'type' => Controls_Manager::SWITCHER,
398
+ 'description' => __('Pagination is the process of dividing the posts into discrete pages','premium-addons-for-elementor'),
399
+ ]
400
+ );
401
402
$this->add_control('premium_blog_new_tab',
403
+ [
404
+ 'label' => __('Links in New Tab', 'premium-addons-for-elementor'),
405
+ 'type' => Controls_Manager::SWITCHER,
406
+ 'description' => __('Enable links to be opened in a new tab','premium-addons-for-elementor'),
407
+ 'default' => 'yes',
408
+ ]
409
+ );
410
411
$this->add_control('premium_blog_number_of_posts',
412
+ [
413
+ 'label' => __('Posts Per Page', 'premium-addons-for-elementor'),
414
+ 'description' => __('Choose how many posts do you want to be displayed per page','premium-addons-for-elementor'),
415
+ 'type' => Controls_Manager::NUMBER,
416
+ 'min' => 1,
417
+ 'default' => 3,
418
+ ]
419
+ );
420
+
421
$this->add_control('premium_blog_offset',
422
[
423
+ 'label' => __( 'Offset Count', 'premium-addons-for-elementor' ),
424
'description' => __('The index of post to start with','premium-addons-for-elementor'),
425
+ 'type' => Controls_Manager::NUMBER,
426
+ 'default' => '0',
427
+ 'min' => '0',
428
]
429
);
430
431
$this->end_controls_section();
432
433
$this->start_controls_section('premium_blog_image_style_section',
434
+ [
435
+ 'label' => __('Image', 'premium-addons-for-elementor'),
436
+ 'tab' => Controls_Manager::TAB_STYLE,
437
+ ]
438
+ );
439
440
$this->add_control('premium_blog_plus_color',
441
+ [
442
+ 'label' => __('Icon Color', 'premium-addons-for-elementor'),
443
+ 'type' => Controls_Manager::COLOR,
444
+ 'scheme' => [
445
+ 'type' => Scheme_Color::get_type(),
446
+ 'value' => Scheme_Color::COLOR_2,
447
+ ],
448
+ 'selectors' => [
449
+ '{{WRAPPER}} .premium-blog-thumbnail-container:before, {{WRAPPER}} .premium-blog-thumbnail-container:after' => 'background-color: {{VALUE}};',
450
+ ]
451
+ ]
452
+ );
453
454
$this->add_control('premium_blog_overlay_color',
455
+ [
456
+ 'label' => __('Overlay Color', 'premium-addons-for-elementor'),
457
+ 'type' => Controls_Manager::COLOR,
458
+ 'scheme' => [
459
+ 'type' => Scheme_Color::get_type(),
460
+ 'value' => Scheme_Color::COLOR_1,
461
+ ],
462
+ 'selectors' => [
463
+ '{{WRAPPER}} .premium-blog-framed-effect, {{WRAPPER}} .premium-blog-bordered-effect,{{WRAPPER}} .premium-blog-squares-effect:before,{{WRAPPER}} .premium-blog-squares-effect:after,{{WRAPPER}} .premium-blog-squares-square-container:before,{{WRAPPER}} .premium-blog-squares-square-container:after, {{WRAPPER}} .premium-blog-format-container:hover,{{WRAPPER}} .premium-blog-pagination-container .current' => 'background-color: {{VALUE}};',
464
+ ]
465
+ ]
466
+ );
467
468
$this->add_control('premium_blog_border_effect_color',
469
+ [
470
+ 'label' => __('Border Color', 'premium-addons-for-elementor'),
471
+ 'type' => Controls_Manager::COLOR,
472
+ 'scheme' => [
473
+ 'type' => Scheme_Color::get_type(),
474
+ 'value' => Scheme_Color::COLOR_2,
475
+ ],
476
+ 'description' => 'Used with Bordered style only',
477
+ 'condition' => [
478
+ 'premium_blog_hover_color_effect' => 'bordered',
479
+ ],
480
+ 'selectors' => [
481
+ '{{WRAPPER}} .premium-blog-bordered-border-container' => 'border-color: {{VALUE}};',
482
+ ],
483
+ ]
484
+ );
485
486
$this->end_controls_section();
487
488
$this->start_controls_section('premium_blog_title_style_section',
489
+ [
490
+ 'label' => __('Title', 'premium-addons-for-elementor'),
491
+ 'tab' => Controls_Manager::TAB_STYLE,
492
+ ]
493
+ );
494
495
$this->add_control('premium_blog_title_color',
496
+ [
497
+ 'label' => __('Color', 'premium-addons-for-elementor'),
498
+ 'type' => Controls_Manager::COLOR,
499
+ 'scheme' => [
500
+ 'type' => Scheme_Color::get_type(),
501
+ 'value' => Scheme_Color::COLOR_2,
502
+ ],
503
+ 'selectors' => [
504
+ '{{WRAPPER}} .premium-blog-entry-title a' => 'color: {{VALUE}};',
505
+ ]
506
+ ]
507
+ );
508
509
$this->add_group_control(
510
Group_Control_Typography::get_type(),
511
+ [
512
+ 'name' => 'premium_blog_title_typo',
513
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_1,
514
+ 'selector' => '{{WRAPPER}} .premium-blog-entry-title',
515
+ ]
516
+ );
517
+
518
$this->add_control('premium_blog_title_hover_color',
519
+ [
520
+ 'label' => __('Hover Color', 'premium-addons-for-elementor'),
521
+ 'type' => Controls_Manager::COLOR,
522
+ 'scheme' => [
523
+ 'type' => Scheme_Color::get_type(),
524
+ 'value' => Scheme_Color::COLOR_1,
525
+ ],
526
+ 'selectors' => [
527
+ '{{WRAPPER}} .premium-blog-entry-title:hover a' => 'color: {{VALUE}};',
528
+ ]
529
+ ]
530
+ );
531
532
$this->end_controls_section();
533
534
$this->start_controls_section('premium_blog_meta_style_section',
535
+ [
536
+ 'label' => __('Meta', 'premium-addons-for-elementor'),
537
+ 'tab' => Controls_Manager::TAB_STYLE,
538
+ ]
539
+ );
540
541
$this->add_control('premium_blog_meta_color',
542
+ [
543
+ 'label' => __('Color', 'premium-addons-for-elementor'),
544
+ 'type' => Controls_Manager::COLOR,
545
+ 'scheme' => [
546
+ 'type' => Scheme_Color::get_type(),
547
+ 'value' => Scheme_Color::COLOR_2,
548
+ ],
549
+ 'selectors' => [
550
+ '{{WRAPPER}} .premium-blog-entry-meta, {{WRAPPER}} .premium-blog-entry-meta a, {{WRAPPER}} .premium-blog-post-content .premium-blog-excerpt-link' => 'color: {{VALUE}};',
551
+ ]
552
+ ]
553
+ );
554
555
556
$this->add_group_control(
557
Group_Control_Typography::get_type(),
558
+ [
559
+ 'name' => 'premium_blog_meta_typo',
560
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_1,
561
+ 'selector' => '{{WRAPPER}} .premium-blog-entry-meta a,{{WRAPPER}} .premium-blog-post-content .premium-blog-excerpt-link',
562
+ ]
563
+ );
564
+
565
$this->add_control('premium_blog_meta_hover_color',
566
+ [
567
+ 'label' => __('Hover Color', 'premium-addons-for-elementor'),
568
+ 'type' => Controls_Manager::COLOR,
569
+ 'scheme' => [
570
+ 'type' => Scheme_Color::get_type(),
571
+ 'value' => Scheme_Color::COLOR_1,
572
+ ],
573
+ 'selectors' => [
574
+ '{{WRAPPER}} .premium-blog-entry-meta a:hover, {{WRAPPER}} .premium-blog-post-content .premium-blog-excerpt-link:hover' => 'color: {{VALUE}};',
575
+ ]
576
+ ]
577
+ );
578
579
$this->end_controls_section();
580
581
$this->start_controls_section('premium_blog_content_style_section',
582
+ [
583
+ 'label' => __('Content', 'premium-addons-for-elementor'),
584
+ 'tab' => Controls_Manager::TAB_STYLE,
585
+ ]
586
+ );
587
588
$this->add_control('premium_blog_post_content_color',
589
+ [
590
+ 'label' => __('Color', 'premium-addons-for-elementor'),
591
+ 'type' => Controls_Manager::COLOR,
592
+ 'scheme' => [
593
+ 'type' => Scheme_Color::get_type(),
594
+ 'value' => Scheme_Color::COLOR_3,
595
+ ],
596
+ 'selectors' => [
597
+ '{{WRAPPER}} .premium-blog-post-content' => 'color: {{VALUE}};',
598
+ ]
599
+ ]
600
+ );
601
+
602
$this->add_group_control(
603
Group_Control_Typography::get_type(),
604
+ [
605
+ 'name' => 'premium_blog_content_typo',
606
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_1,
607
+ 'selector' => '{{WRAPPER}} .premium-blog-post-content',
608
+ ]
609
+ );
610
611
$this->add_control('premium_blog_content_background_color',
612
+ [
613
+ 'label' => __('Background Color', 'premium-addons-for-elementor'),
614
+ 'type' => Controls_Manager::COLOR,
615
+ 'default' => '#f5f5f5',
616
+ 'selectors' => [
617
+ '{{WRAPPER}} .premium-blog-content-wrapper' => 'background-color: {{VALUE}};',
618
+ ]
619
+ ]
620
+ );
621
+
622
$this->end_controls_section();
623
624
$this->start_controls_section('premium_blog_tags_style_section',
625
+ [
626
+ 'label' => __('Tags', 'premium-addons-for-elementor'),
627
+ 'tab' => Controls_Manager::TAB_STYLE,
628
+ ]
629
+ );
630
631
$this->add_control('premium_blog_tags_color',
632
+ [
633
+ 'label' => __('Color', 'premium-addons-for-elementor'),
634
+ 'type' => Controls_Manager::COLOR,
635
+ 'scheme' => [
636
+ 'type' => Scheme_Color::get_type(),
637
+ 'value' => Scheme_Color::COLOR_2,
638
+ ],
639
+ 'selectors' => [
640
+ '{{WRAPPER}} .premium-blog-post-tags-container, {{WRAPPER}} .premium-blog-post-tags-container a' => 'color: {{VALUE}};',
641
+ ]
642
+ ]
643
+ );
644
645
$this->add_group_control(
646
Group_Control_Typography::get_type(),
647
+ [
648
+ 'name' => 'premium_blog_tags_typo',
649
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_1,
650
+ 'selector' => '{{WRAPPER}} .premium-blog-post-tags-container a',
651
+ ]
652
+ );
653
+
654
$this->add_control('premium_blog_tags_hoer_color',
655
+ [
656
+ 'label' => __('Hover Color', 'premium-addons-for-elementor'),
657
+ 'type' => Controls_Manager::COLOR,
658
+ 'scheme' => [
659
+ 'type' => Scheme_Color::get_type(),
660
+ 'value' => Scheme_Color::COLOR_1,
661
+ ],
662
+ 'selectors' => [
663
+ '{{WRAPPER}} .premium-blog-post-tags-container a:hover' => 'color: {{VALUE}};',
664
+ ]
665
+ ]
666
+ );
667
668
$this->end_controls_section();
669
670
$this->start_controls_section('premium_blog_format_style_section',
671
+ [
672
+ 'label' => __('Post Format Icon', 'premium-addons-for-elementor'),
673
+ 'tab' => Controls_Manager::TAB_STYLE,
674
+ 'condition' => [
675
+ 'premium_blog_post_format_icon' => 'yes'
676
+ ]
677
+ ]
678
+ );
679
680
$this->add_control('premium_blog_format_icon_size',
681
+ [
682
+ 'label' => __('Size', 'premium-addons-for-elementor'),
683
+ 'type' => Controls_Manager::SLIDER,
684
+ 'description' => __('Choose icon size in (PX, EM)', 'premium-addons-for-elementor'),
685
+ 'range' => [
686
+ 'em' => [
687
+ 'min' => 1,
688
+ 'max' => 10,
689
],
690
+ ],
691
+ 'size_units' => ['px', "em"],
692
+ 'label_block' => true,
693
+ 'selectors' => [
694
+ '{{WRAPPER}} .premium-blog-format-icon' => 'font-size: {{SIZE}}{{UNIT}};',
695
+ ]
696
+ ]
697
+ );
698
699
+ $this->add_control('premium_blog_format_icon_color',
700
+ [
701
+ 'label' => __('Color', 'premium-addons-for-elementor'),
702
+ 'type' => Controls_Manager::COLOR,
703
+ 'scheme' => [
704
+ 'type' => Scheme_Color::get_type(),
705
+ 'value' => Scheme_Color::COLOR_2,
706
+ ],
707
+ 'selectors' => [
708
+ '{{WRAPPER}} .premium-blog-format-container i' => 'color: {{VALUE}};',
709
+ ]
710
+ ]
711
+ );
712
+
713
$this->add_control('premium_blog_format_icon_hover_color',
714
+ [
715
+ 'label' => __('Hover Color', 'premium-addons-for-elementor'),
716
+ 'type' => Controls_Manager::COLOR,
717
+ 'scheme' => [
718
+ 'type' => Scheme_Color::get_type(),
719
+ 'value' => Scheme_Color::COLOR_1,
720
+ ],
721
+ 'selectors' => [
722
+ '{{WRAPPER}} .premium-blog-format-container:hover i' => 'color: {{VALUE}};',
723
+ ]
724
+ ]
725
+ );
726
727
$this->add_control('premium_blog_format_back_color',
728
+ [
729
+ 'label' => __('Background Color', 'premium-addons-for-elementor'),
730
+ 'type' => Controls_Manager::COLOR,
731
+ 'scheme' => [
732
+ 'type' => Scheme_Color::get_type(),
733
+ 'value' => Scheme_Color::COLOR_1,
734
+ ],
735
+ 'selectors' => [
736
+ '{{WRAPPER}} .premium-blog-format-container' => 'background-color: {{VALUE}};',
737
+ ]
738
+ ]
739
+ );
740
741
$this->add_control('premium_blog_format_back_hover_color',
742
+ [
743
+ 'label' => __('Hover Background Color', 'premium-addons-for-elementor'),
744
+ 'type' => Controls_Manager::COLOR,
745
+ 'scheme' => [
746
+ 'type' => Scheme_Color::get_type(),
747
+ 'value' => Scheme_Color::COLOR_2,
748
+ ],
749
+ 'selectors' => [
750
+ '{{WRAPPER}} .premium-blog-format-container:hover' => 'background-color: {{VALUE}};',
751
+ ]
752
+ ]
753
+ );
754
755
$this->end_controls_section();
756
757
$this->start_controls_section('premium_blog_pagination_Style',
758
[
759
'label' => __('Pagination Style', 'premium-addons-for-elementor'),
760
+ 'tab' => Controls_Manager::TAB_STYLE,
761
'condition' => [
762
'premium_blog_paging' => 'yes',
763
]
764
+ ]
765
+ );
766
767
$this->start_controls_tabs('premium_blog_pagination_colors');
768
770
[
771
'label' => __('Normal', 'premium-addons-for-elementor'),
772
773
+ ]
774
+ );
775
776
$this->add_control('prmeium_blog_pagination_color',
777
[
784
'selectors' => [
785
'{{WRAPPER}} .premium-blog-pagination-container li a, {{WRAPPER}} .premium-blog-pagination-container li span' => 'color: {{VALUE}};'
786
]
787
+ ]
788
+ );
789
790
$this->add_control('prmeium_blog_pagination_back_color',
791
[
798
'selectors' => [
799
'{{WRAPPER}} .premium-blog-pagination-container li a, {{WRAPPER}} .premium-blog-pagination-container li span' => 'background-color: {{VALUE}};'
800
]
801
+ ]
802
+ );
803
804
$this->end_controls_tab();
805
807
[
808
'label' => __('Hover', 'premium-addons-for-elementor'),
809
810
+ ]
811
+ );
812
813
$this->add_control('prmeium_blog_pagination_hover_color',
814
[
821
'selectors' => [
822
'{{WRAPPER}} .premium-blog-pagination-container li:hover a, {{WRAPPER}} .premium-blog-pagination-container li:hover span' => 'color: {{VALUE}};'
823
]
824
+ ]
825
+ );
826
827
$this->add_control('prmeium_blog_pagination_back_hover_color',
828
[
835
'selectors' => [
836
'{{WRAPPER}} .premium-blog-pagination-container li:hover a, {{WRAPPER}} .premium-blog-pagination-container li:hover span' => 'background-color: {{VALUE}};'
837
]
838
+ ]
839
+ );
840
841
$this->end_controls_tab();
842
843
$this->end_controls_tabs();
844
845
$this->end_controls_section();
846
847
}
848
849
+ protected function get_post_content(){
850
+
851
+ $settings = $this->get_settings();
852
853
+ $excerpt_type = $settings['premium_blog_excerpt_type'];
854
+ $excerpt_text = $settings['premium_blog_excerpt_text'];
855
+
856
+ if ( $settings['premium_blog_excerpt'] === 'yes' ) {
857
+ echo premium_addons_get_excerpt_by_id( get_the_ID(), $settings['premium_blog_excerpt_length'], $excerpt_type, $excerpt_text );
858
+ } else {
859
+ the_content();
860
+ }
861
}
862
863
+
864
+ protected function get_post_format_icon() {
865
866
+ $post_format = get_post_format();
867
+
868
+ switch( $post_format ) {
869
+ case 'aside':
870
+ $post_format = 'file-text-o';
871
+ break;
872
+ case 'audio':
873
+ $post_format = 'music';
874
+ break;
875
+ case 'gallery':
876
+ $post_format = 'file-image-o';
877
+ break;
878
+ case 'image':
879
+ $post_format = 'picture-o';
880
+ break;
881
+ case 'link':
882
+ $post_format = 'link';
883
+ break;
884
+ case 'quote':
885
+ $post_format = 'quote-left';
886
+ break;
887
+ case 'video':
888
+ $post_format = 'video-camera';
889
+ break;
890
+ default:
891
+ $post_format = 'thumb-tack';
892
}
893
+ ?>
894
+ <i class="premium-blog-format-icon fa fa-<?php echo $post_format; ?>"></i>
895
+ <?php
896
+ }
897
+
898
+
899
+ protected function get_post_layout() {
900
901
$settings = $this->get_settings();
902
903
+ $image_effect = $settings['premium_blog_hover_image_effect'];
904
+
905
+ $post_effect = $settings['premium_blog_hover_color_effect'];
906
+
907
+ if( $settings['premium_blog_new_tab'] == 'yes' ) {
908
$target = '_blank';
909
} else {
910
$target = '_self';
911
}
912
+
913
+ $date_format = get_option('date_format');
914
+
915
+ $this->add_render_attribute( 'title', 'class', 'premium-blog-entry-title' );
916
+ ?>
917
918
+ <div class="premium-blog-post-container">
919
+ <div class="premium-blog-thumb-effect-wrapper">
920
+ <div class="premium-blog-thumbnail-container <?php echo 'premium-blog-' . $image_effect . '-effect';?>">
921
+ <a href="<?php the_permalink(); ?>" target="<?php echo esc_attr($target); ?>"><?php the_post_thumbnail('full'); ?></a>
922
+ </div>
923
+ <div class="premium-blog-effect-container <?php echo 'premium-blog-'. $post_effect . '-effect'; ?>">
924
+ <a class="premium-blog-post-link" href="<?php the_permalink(); ?>" target="<?php echo esc_attr($target); ?>"></a>
925
+ <?php if( $settings['premium_blog_hover_color_effect'] === 'bordered' ) : ?>
926
+ <div class="premium-blog-bordered-border-container"></div>
927
+ <?php elseif( $settings['premium_blog_hover_color_effect'] === 'squares' ) : ?>
928
+ <div class="premium-blog-squares-square-container"></div>
929
+ <?php endif; ?>
930
+ </div>
931
+ </div>
932
+ <div class="premium-blog-content-wrapper <?php echo (!has_post_thumbnail()) ? 'empty-thumb' : ''; ?>">
933
+ <div class="premium-blog-inner-container">
934
+ <?php if( $settings['premium_blog_post_format_icon'] === 'yes' ) : ?>
935
+ <div class="premium-blog-format-container">
936
+ <a class="premium-blog-format-link" href="<?php the_permalink(); ?>" title="<?php if( get_post_format() === ' ') : echo 'standard' ; else : echo get_post_format(); endif; ?>" target="<?php echo esc_attr($target); ?>"><?php $this->get_post_format_icon(); ?></a>
937
+ </div>
938
+ <?php endif; ?>
939
+ <div class="premium-blog-entry-container">
940
+ <<?php echo $settings['premium_blog_title_tag'] . ' ' . $this->get_render_attribute_string('title'); ?>><a href="<?php the_permalink(); ?>" target="<?php echo esc_attr($target); ?>"><?php the_title(); ?></a></<?php echo $settings['premium_blog_title_tag']; ?>>
941
+ <div class="premium-blog-entry-meta" style="<?php if( $settings['premium_blog_post_format_icon'] !== 'yes' ) : echo 'margin-left:0px'; endif; ?>">
942
+ <?php if( $settings['premium_blog_author_meta'] === 'yes' ) : ?>
943
+ <span class="premium-blog-post-author premium-blog-meta-data"><i class="fa fa-user fa-fw"></i><?php the_author_posts_link();?></span>
944
+ <?php endif; ?>
945
+ <?php if( $settings['premium_blog_date_meta'] === 'yes' ) : ?>
946
+ <span class="premium-blog-post-time premium-blog-meta-data"><i class="fa fa-calendar fa-fw"></i><a href="<?php the_permalink(); ?>" target="<?php echo esc_attr($target); ?>"><?php the_time($date_format); ?></a></span>
947
+ <?php endif; ?>
948
+ <?php if( $settings['premium_blog_categories_meta'] === 'yes' ) : ?>
949
+