| 1 | <?php |
|---|
| 2 | namespace Elementor; |
|---|
| 3 | |
|---|
| 4 | // Elementor Classes |
|---|
| 5 | if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
|---|
| 6 | |
|---|
| 7 | class HTMega_Elementor_Widget_Post_Carousel extends Widget_Base { |
|---|
| 8 | |
|---|
| 9 | public function get_name() { |
|---|
| 10 | return 'htmega-postcarousel-addons'; |
|---|
| 11 | } |
|---|
| 12 | |
|---|
| 13 | public function get_title() { |
|---|
| 14 | return __( 'Post carousel', 'htmega-addons' ); |
|---|
| 15 | } |
|---|
| 16 | |
|---|
| 17 | public function get_icon() { |
|---|
| 18 | return 'htmega-icon eicon-posts-carousel'; |
|---|
| 19 | } |
|---|
| 20 | |
|---|
| 21 | public function get_categories() { |
|---|
| 22 | return [ 'htmega-addons' ]; |
|---|
| 23 | } |
|---|
| 24 | |
|---|
| 25 | public function get_style_depends() { |
|---|
| 26 | return [ |
|---|
| 27 | 'slick', |
|---|
| 28 | 'htmega-widgets', |
|---|
| 29 | ]; |
|---|
| 30 | } |
|---|
| 31 | |
|---|
| 32 | public function get_script_depends() { |
|---|
| 33 | return [ |
|---|
| 34 | 'slick', |
|---|
| 35 | 'htmega-widgets-scripts', |
|---|
| 36 | ]; |
|---|
| 37 | } |
|---|
| 38 | |
|---|
| 39 | public function get_keywords() { |
|---|
| 40 | return [ 'post slider', 'slider widget','carousel','post carousel','htmega','ht mega' ]; |
|---|
| 41 | } |
|---|
| 42 | |
|---|
| 43 | public function get_help_url() { |
|---|
| 44 | return 'https://wphtmega.com/docs/post-widgets/post-carousel-widget/'; |
|---|
| 45 | } |
|---|
| 46 | |
|---|
| 47 | protected function register_controls() { |
|---|
| 48 | |
|---|
| 49 | $this->start_controls_section( |
|---|
| 50 | 'post_carousel_content', |
|---|
| 51 | [ |
|---|
| 52 | 'label' => __( 'Post carousel', 'htmega-addons' ), |
|---|
| 53 | ] |
|---|
| 54 | ); |
|---|
| 55 | |
|---|
| 56 | $this->add_control( |
|---|
| 57 | 'post_carousel_style', |
|---|
| 58 | [ |
|---|
| 59 | 'label' => __( 'Layout', 'htmega-addons' ), |
|---|
| 60 | 'type' => 'htmega-preset-select', |
|---|
| 61 | 'default' => '1', |
|---|
| 62 | 'options' => [ |
|---|
| 63 | '1' => __( 'Layout One', 'htmega-addons' ), |
|---|
| 64 | '2' => __( 'Layout Two', 'htmega-addons' ), |
|---|
| 65 | '3' => __( 'Layout Three', 'htmega-addons' ), |
|---|
| 66 | '4' => __( 'Layout Four', 'htmega-addons' ), |
|---|
| 67 | '5' => __( 'Layout Five', 'htmega-addons' ), |
|---|
| 68 | ], |
|---|
| 69 | ] |
|---|
| 70 | ); |
|---|
| 71 | |
|---|
| 72 | $this->add_control( |
|---|
| 73 | 'slider_on', |
|---|
| 74 | [ |
|---|
| 75 | 'label' => __( 'Carousel', 'htmega-addons' ), |
|---|
| 76 | 'type' => Controls_Manager::SWITCHER, |
|---|
| 77 | 'label_on' => __( 'On', 'htmega-addons' ), |
|---|
| 78 | 'label_off' => __( 'Off', 'htmega-addons' ), |
|---|
| 79 | 'return_value' => 'yes', |
|---|
| 80 | 'default' => 'yes', |
|---|
| 81 | ] |
|---|
| 82 | ); |
|---|
| 83 | |
|---|
| 84 | $this->end_controls_section(); |
|---|
| 85 | |
|---|
| 86 | // Content Option Start |
|---|
| 87 | $this->start_controls_section( |
|---|
| 88 | 'post_content_option', |
|---|
| 89 | [ |
|---|
| 90 | 'label' => __( 'Post Option', 'htmega-addons' ), |
|---|
| 91 | ] |
|---|
| 92 | ); |
|---|
| 93 | |
|---|
| 94 | |
|---|
| 95 | |
|---|
| 96 | $this->show_post_source(); |
|---|
| 97 | |
|---|
| 98 | $this->add_control( |
|---|
| 99 | 'show_category', |
|---|
| 100 | [ |
|---|
| 101 | 'label' => esc_html__( 'Category', 'htmega-addons' ), |
|---|
| 102 | 'type' => Controls_Manager::SWITCHER, |
|---|
| 103 | 'return_value' => 'yes', |
|---|
| 104 | 'default' => 'yes', |
|---|
| 105 | ] |
|---|
| 106 | ); |
|---|
| 107 | |
|---|
| 108 | $this->add_control( |
|---|
| 109 | 'show_date', |
|---|
| 110 | [ |
|---|
| 111 | 'label' => esc_html__( 'Date', 'htmega-addons' ), |
|---|
| 112 | 'type' => Controls_Manager::SWITCHER, |
|---|
| 113 | 'return_value' => 'yes', |
|---|
| 114 | 'default' => 'yes', |
|---|
| 115 | ] |
|---|
| 116 | ); |
|---|
| 117 | |
|---|
| 118 | $this->add_control( |
|---|
| 119 | 'show_title', |
|---|
| 120 | [ |
|---|
| 121 | 'label' => esc_html__( 'Title', 'htmega-addons' ), |
|---|
| 122 | 'type' => Controls_Manager::SWITCHER, |
|---|
| 123 | 'return_value' => 'yes', |
|---|
| 124 | 'default' => 'yes', |
|---|
| 125 | ] |
|---|
| 126 | ); |
|---|
| 127 | |
|---|
| 128 | $this->add_control( |
|---|
| 129 | 'title_length', |
|---|
| 130 | [ |
|---|
| 131 | 'label' => __( 'Title Length', 'htmega-addons' ), |
|---|
| 132 | 'type' => Controls_Manager::NUMBER, |
|---|
| 133 | 'step' => 1, |
|---|
| 134 | 'default' => 5, |
|---|
| 135 | 'condition'=>[ |
|---|
| 136 | 'show_title'=>'yes', |
|---|
| 137 | ] |
|---|
| 138 | ] |
|---|
| 139 | ); |
|---|
| 140 | $this->add_control( |
|---|
| 141 | 'show_content', |
|---|
| 142 | [ |
|---|
| 143 | 'label' => esc_html__( 'Show Content', 'htmega-addons' ), |
|---|
| 144 | 'type' => Controls_Manager::SWITCHER, |
|---|
| 145 | 'return_value' => 'yes', |
|---|
| 146 | 'default' => 'yes', |
|---|
| 147 | ] |
|---|
| 148 | ); |
|---|
| 149 | $this->add_control( |
|---|
| 150 | 'content_type', |
|---|
| 151 | [ |
|---|
| 152 | 'label' => esc_html__( 'Content Source', 'htmega-addons' ), |
|---|
| 153 | 'type' => Controls_Manager::SELECT, |
|---|
| 154 | 'default' => 'content', |
|---|
| 155 | 'options' => [ |
|---|
| 156 | 'content' => esc_html__('Content','htmega-addons'), |
|---|
| 157 | 'excerpt' => esc_html__('Excerpt','htmega-addons'), |
|---|
| 158 | ], |
|---|
| 159 | 'condition'=>[ |
|---|
| 160 | 'show_content'=>'yes', |
|---|
| 161 | ] |
|---|
| 162 | ] |
|---|
| 163 | ); |
|---|
| 164 | $this->add_control( |
|---|
| 165 | 'content_length', |
|---|
| 166 | [ |
|---|
| 167 | 'label' => __( 'Content Length', 'htmega-addons' ), |
|---|
| 168 | 'type' => Controls_Manager::NUMBER, |
|---|
| 169 | 'step' => 1, |
|---|
| 170 | 'default' => 20, |
|---|
| 171 | 'condition'=>[ |
|---|
| 172 | 'show_content'=>'yes', |
|---|
| 173 | ] |
|---|
| 174 | ] |
|---|
| 175 | ); |
|---|
| 176 | |
|---|
| 177 | $this->add_control( |
|---|
| 178 | 'show_read_more_btn', |
|---|
| 179 | [ |
|---|
| 180 | 'label' => esc_html__( 'Read More', 'htmega-addons' ), |
|---|
| 181 | 'type' => Controls_Manager::SWITCHER, |
|---|
| 182 | 'return_value' => 'yes', |
|---|
| 183 | 'default' => 'yes', |
|---|
| 184 | ] |
|---|
| 185 | ); |
|---|
| 186 | |
|---|
| 187 | $this->add_control( |
|---|
| 188 | 'read_more_txt', |
|---|
| 189 | [ |
|---|
| 190 | 'label' => __( 'Read More button text', 'htmega-addons' ), |
|---|
| 191 | 'type' => Controls_Manager::TEXT, |
|---|
| 192 | 'default' => __( 'Read More', 'htmega-addons' ), |
|---|
| 193 | 'placeholder' => __( 'Read More', 'htmega-addons' ), |
|---|
| 194 | 'label_block'=>true, |
|---|
| 195 | 'condition'=>[ |
|---|
| 196 | 'show_read_more_btn'=>'yes', |
|---|
| 197 | ] |
|---|
| 198 | ] |
|---|
| 199 | ); |
|---|
| 200 | |
|---|
| 201 | $this->add_control( |
|---|
| 202 | 'show_author', |
|---|
| 203 | [ |
|---|
| 204 | 'label' => esc_html__( 'Author', 'htmega-addons' ), |
|---|
| 205 | 'type' => Controls_Manager::SWITCHER, |
|---|
| 206 | 'return_value' => 'yes', |
|---|
| 207 | 'default' => 'yes', |
|---|
| 208 | ] |
|---|
| 209 | ); |
|---|
| 210 | |
|---|
| 211 | $this->end_controls_section(); // Content Option End |
|---|
| 212 | |
|---|
| 213 | // Carousel setting |
|---|
| 214 | $this->start_controls_section( |
|---|
| 215 | 'slider_option', |
|---|
| 216 | [ |
|---|
| 217 | 'label' => esc_html__( 'Carousel Option', 'htmega-addons' ), |
|---|
| 218 | 'condition' => [ |
|---|
| 219 | 'slider_on' => 'yes', |
|---|
| 220 | ] |
|---|
| 221 | ] |
|---|
| 222 | ); |
|---|
| 223 | |
|---|
| 224 | $this->add_control( |
|---|
| 225 | 'slitems', |
|---|
| 226 | [ |
|---|
| 227 | 'label' => esc_html__( 'Slider Items', 'htmega-addons' ), |
|---|
| 228 | 'type' => Controls_Manager::NUMBER, |
|---|
| 229 | 'min' => 1, |
|---|
| 230 | 'max' => 20, |
|---|
| 231 | 'step' => 1, |
|---|
| 232 | 'default' => 3, |
|---|
| 233 | 'condition' => [ |
|---|
| 234 | 'slider_on' => 'yes', |
|---|
| 235 | ] |
|---|
| 236 | ] |
|---|
| 237 | ); |
|---|
| 238 | |
|---|
| 239 | $this->add_responsive_control( |
|---|
| 240 | 'sli_gutter', |
|---|
| 241 | [ |
|---|
| 242 | 'label' => esc_html__( 'Column Space', 'htmega-addons' ), |
|---|
| 243 | 'type' => Controls_Manager::NUMBER, |
|---|
| 244 | 'min' => 0, |
|---|
| 245 | 'max' => 200, |
|---|
| 246 | 'step' => 1, |
|---|
| 247 | 'default' => 15, |
|---|
| 248 | 'selectors' => [ |
|---|
| 249 | '{{WRAPPER}} .post-carousel-wrapper' => 'margin: 0 -{{VALUE}}px', |
|---|
| 250 | '{{WRAPPER}} .post-carousel-wrapper .slick-slide' => 'margin: 0 {{VALUE}}px', |
|---|
| 251 | ], |
|---|
| 252 | 'condition' => [ |
|---|
| 253 | 'slider_on' => 'yes', |
|---|
| 254 | ] |
|---|
| 255 | ] |
|---|
| 256 | ); |
|---|
| 257 | $this->add_control( |
|---|
| 258 | 'equal_height_column', |
|---|
| 259 | [ |
|---|
| 260 | 'label' => esc_html__( 'Equal Height Column', 'htmega-addons' ), |
|---|
| 261 | 'type' => Controls_Manager::SWITCHER, |
|---|
| 262 | 'return_value' => 'yes', |
|---|
| 263 | 'separator' => 'before', |
|---|
| 264 | 'default' => 'no', |
|---|
| 265 | 'condition' => [ |
|---|
| 266 | 'slider_on' => 'yes', |
|---|
| 267 | ] |
|---|
| 268 | ] |
|---|
| 269 | ); |
|---|
| 270 | $this->add_control( |
|---|
| 271 | 'slarrows', |
|---|
| 272 | [ |
|---|
| 273 | 'label' => esc_html__( 'Slider Arrow', 'htmega-addons' ), |
|---|
| 274 | 'type' => Controls_Manager::SWITCHER, |
|---|
| 275 | 'return_value' => 'yes', |
|---|
| 276 | 'default' => 'yes', |
|---|
| 277 | 'condition' => [ |
|---|
| 278 | 'slider_on' => 'yes', |
|---|
| 279 | ] |
|---|
| 280 | ] |
|---|
| 281 | ); |
|---|
| 282 | |
|---|
| 283 | $this->add_control( |
|---|
| 284 | 'slprevicon', |
|---|
| 285 | [ |
|---|
| 286 | 'label' => __( 'Previous icon', 'htmega-addons' ), |
|---|
| 287 | 'type' => Controls_Manager::ICONS, |
|---|
| 288 | 'default' => [ |
|---|
| 289 | 'value'=>'fas fa-angle-left', |
|---|
| 290 | 'library' => 'solid', |
|---|
| 291 | ], |
|---|
| 292 | 'condition' => [ |
|---|
| 293 | 'slider_on' => 'yes', |
|---|
| 294 | 'slarrows' => 'yes', |
|---|
| 295 | ] |
|---|
| 296 | ] |
|---|
| 297 | ); |
|---|
| 298 | |
|---|
| 299 | $this->add_control( |
|---|
| 300 | 'slnexticon', |
|---|
| 301 | [ |
|---|
| 302 | 'label' => __( 'Next icon', 'htmega-addons' ), |
|---|
| 303 | 'type' => Controls_Manager::ICONS, |
|---|
| 304 | 'default' => 'fas fa-angle-right', |
|---|
| 305 | 'default' => [ |
|---|
| 306 | 'value'=>'fas fa-angle-right', |
|---|
| 307 | 'library' => 'solid', |
|---|
| 308 | ], |
|---|
| 309 | 'condition' => [ |
|---|
| 310 | 'slider_on' => 'yes', |
|---|
| 311 | 'slarrows' => 'yes', |
|---|
| 312 | ] |
|---|
| 313 | ] |
|---|
| 314 | ); |
|---|
| 315 | |
|---|
| 316 | $this->add_control( |
|---|
| 317 | 'sldots', |
|---|
| 318 | [ |
|---|
| 319 | 'label' => esc_html__( 'Slider dots', 'htmega-addons' ), |
|---|
| 320 | 'type' => Controls_Manager::SWITCHER, |
|---|
| 321 | 'return_value' => 'yes', |
|---|
| 322 | 'default' => 'no', |
|---|
| 323 | 'condition' => [ |
|---|
| 324 | 'slider_on' => 'yes', |
|---|
| 325 | ] |
|---|
| 326 | ] |
|---|
| 327 | ); |
|---|
| 328 | |
|---|
| 329 | $this->add_control( |
|---|
| 330 | 'slpause_on_hover', |
|---|
| 331 | [ |
|---|
| 332 | 'type' => Controls_Manager::SWITCHER, |
|---|
| 333 | 'label_off' => __('No', 'htmega-addons'), |
|---|
| 334 | 'label_on' => __('Yes', 'htmega-addons'), |
|---|
| 335 | 'return_value' => 'yes', |
|---|
| 336 | 'default' => 'yes', |
|---|
| 337 | 'label' => __('Pause on Hover?', 'htmega-addons'), |
|---|
| 338 | 'condition' => [ |
|---|
| 339 | 'slider_on' => 'yes', |
|---|
| 340 | ] |
|---|
| 341 | ] |
|---|
| 342 | ); |
|---|
| 343 | |
|---|
| 344 | $this->add_control( |
|---|
| 345 | 'slcentermode', |
|---|
| 346 | [ |
|---|
| 347 | 'label' => esc_html__( 'Center Mode', 'htmega-addons' ), |
|---|
| 348 | 'type' => Controls_Manager::SWITCHER, |
|---|
| 349 | 'return_value' => 'yes', |
|---|
| 350 | 'default' => 'no', |
|---|
| 351 | 'condition' => [ |
|---|
| 352 | 'slider_on' => 'yes', |
|---|
| 353 | ] |
|---|
| 354 | ] |
|---|
| 355 | ); |
|---|
| 356 | |
|---|
| 357 | $this->add_control( |
|---|
| 358 | 'slcenterpadding', |
|---|
| 359 | [ |
|---|
| 360 | 'label' => esc_html__( 'Center padding', 'htmega-addons' ), |
|---|
| 361 | 'type' => Controls_Manager::NUMBER, |
|---|
| 362 | 'min' => 0, |
|---|
| 363 | 'max' => 500, |
|---|
| 364 | 'step' => 1, |
|---|
| 365 | 'default' => 50, |
|---|
| 366 | 'condition' => [ |
|---|
| 367 | 'slider_on' => 'yes', |
|---|
| 368 | 'slcentermode' => 'yes', |
|---|
| 369 | ] |
|---|
| 370 | ] |
|---|
| 371 | ); |
|---|
| 372 | |
|---|
| 373 | $this->add_control( |
|---|
| 374 | 'slautolay', |
|---|
| 375 | [ |
|---|
| 376 | 'label' => esc_html__( 'Slider auto play', 'htmega-addons' ), |
|---|
| 377 | 'type' => Controls_Manager::SWITCHER, |
|---|
| 378 | 'return_value' => 'yes', |
|---|
| 379 | 'separator' => 'before', |
|---|
| 380 | 'default' => 'no', |
|---|
| 381 | 'condition' => [ |
|---|
| 382 | 'slider_on' => 'yes', |
|---|
| 383 | ] |
|---|
| 384 | ] |
|---|
| 385 | ); |
|---|
| 386 | |
|---|
| 387 | $this->add_control( |
|---|
| 388 | 'slautoplay_speed', |
|---|
| 389 | [ |
|---|
| 390 | 'label' => __('Autoplay speed', 'htmega-addons'), |
|---|
| 391 | 'type' => Controls_Manager::NUMBER, |
|---|
| 392 | 'default' => 3000, |
|---|
| 393 | 'condition' => [ |
|---|
| 394 | 'slider_on' => 'yes', |
|---|
| 395 | ] |
|---|
| 396 | ] |
|---|
| 397 | ); |
|---|
| 398 | $this->add_control( |
|---|
| 399 | 'slanimation_speed', |
|---|
| 400 | [ |
|---|
| 401 | 'label' => __('Autoplay animation speed', 'htmega-addons'), |
|---|
| 402 | 'type' => Controls_Manager::NUMBER, |
|---|
| 403 | 'default' => 300, |
|---|
| 404 | 'condition' => [ |
|---|
| 405 | 'slider_on' => 'yes', |
|---|
| 406 | ] |
|---|
| 407 | ] |
|---|
| 408 | ); |
|---|
| 409 | $this->add_control( |
|---|
| 410 | 'slloop', |
|---|
| 411 | [ |
|---|
| 412 | 'label' => esc_html__( 'Slide Loop', 'htmega-addons' ), |
|---|
| 413 | 'type' => Controls_Manager::SWITCHER, |
|---|
| 414 | 'return_value' => 'yes', |
|---|
| 415 | 'default' => 'yes', |
|---|
| 416 | 'condition' => [ |
|---|
| 417 | 'slider_on' => 'yes', |
|---|
| 418 | ] |
|---|
| 419 | ] |
|---|
| 420 | ); |
|---|
| 421 | $this->add_control( |
|---|
| 422 | 'slscroll_columns', |
|---|
| 423 | [ |
|---|
| 424 | 'label' => __('Slider item to scroll', 'htmega-addons'), |
|---|
| 425 | 'type' => Controls_Manager::NUMBER, |
|---|
| 426 | 'min' => 1, |
|---|
| 427 | 'max' => 10, |
|---|
| 428 | 'step' => 1, |
|---|
| 429 | 'default' => 1, |
|---|
| 430 | 'condition' => [ |
|---|
| 431 | 'slider_on' => 'yes', |
|---|
| 432 | ] |
|---|
| 433 | ] |
|---|
| 434 | ); |
|---|
| 435 | |
|---|
| 436 | $this->add_control( |
|---|
| 437 | 'heading_tablet', |
|---|
| 438 | [ |
|---|
| 439 | 'label' => __( 'Tablet', 'htmega-addons' ), |
|---|
| 440 | 'type' => Controls_Manager::HEADING, |
|---|
| 441 | 'separator' => 'after', |
|---|
| 442 | 'condition' => [ |
|---|
| 443 | 'slider_on' => 'yes', |
|---|
| 444 | ] |
|---|
| 445 | ] |
|---|
| 446 | ); |
|---|
| 447 | |
|---|
| 448 | $this->add_control( |
|---|
| 449 | 'sltablet_display_columns', |
|---|
| 450 | [ |
|---|
| 451 | 'label' => __('Slider Items', 'htmega-addons'), |
|---|
| 452 | 'type' => Controls_Manager::NUMBER, |
|---|
| 453 | 'min' => 1, |
|---|
| 454 | 'max' => 8, |
|---|
| 455 | 'step' => 1, |
|---|
| 456 | 'default' => 1, |
|---|
| 457 | 'condition' => [ |
|---|
| 458 | 'slider_on' => 'yes', |
|---|
| 459 | ] |
|---|
| 460 | ] |
|---|
| 461 | ); |
|---|
| 462 | |
|---|
| 463 | $this->add_control( |
|---|
| 464 | 'sltablet_scroll_columns', |
|---|
| 465 | [ |
|---|
| 466 | 'label' => __('Slider item to scroll', 'htmega-addons'), |
|---|
| 467 | 'type' => Controls_Manager::NUMBER, |
|---|
| 468 | 'min' => 1, |
|---|
| 469 | 'max' => 8, |
|---|
| 470 | 'step' => 1, |
|---|
| 471 | 'default' => 1, |
|---|
| 472 | 'condition' => [ |
|---|
| 473 | 'slider_on' => 'yes', |
|---|
| 474 | ] |
|---|
| 475 | ] |
|---|
| 476 | ); |
|---|
| 477 | |
|---|
| 478 | $this->add_control( |
|---|
| 479 | 'sltablet_width', |
|---|
| 480 | [ |
|---|
| 481 | 'label' => __('Tablet Resolution', 'htmega-addons'), |
|---|
| 482 | 'description' => __('The resolution to tablet.', 'htmega-addons'), |
|---|
| 483 | 'type' => Controls_Manager::NUMBER, |
|---|
| 484 | 'default' => 750, |
|---|
| 485 | 'condition' => [ |
|---|
| 486 | 'slider_on' => 'yes', |
|---|
| 487 | ] |
|---|
| 488 | ] |
|---|
| 489 | ); |
|---|
| 490 | |
|---|
| 491 | $this->add_control( |
|---|
| 492 | 'heading_mobile', |
|---|
| 493 | [ |
|---|
| 494 | 'label' => __( 'Mobile Phone', 'htmega-addons' ), |
|---|
| 495 | 'type' => Controls_Manager::HEADING, |
|---|
| 496 | 'separator' => 'after', |
|---|
| 497 | 'condition' => [ |
|---|
| 498 | 'slider_on' => 'yes', |
|---|
| 499 | ] |
|---|
| 500 | ] |
|---|
| 501 | ); |
|---|
| 502 | |
|---|
| 503 | $this->add_control( |
|---|
| 504 | 'slmobile_display_columns', |
|---|
| 505 | [ |
|---|
| 506 | 'label' => __('Slider Items', 'htmega-addons'), |
|---|
| 507 | 'type' => Controls_Manager::NUMBER, |
|---|
| 508 | 'min' => 1, |
|---|
| 509 | 'max' => 4, |
|---|
| 510 | 'step' => 1, |
|---|
| 511 | 'default' => 1, |
|---|
| 512 | 'condition' => [ |
|---|
| 513 | 'slider_on' => 'yes', |
|---|
| 514 | ] |
|---|
| 515 | ] |
|---|
| 516 | ); |
|---|
| 517 | |
|---|
| 518 | $this->add_control( |
|---|
| 519 | 'slmobile_scroll_columns', |
|---|
| 520 | [ |
|---|
| 521 | 'label' => __('Slider item to scroll', 'htmega-addons'), |
|---|
| 522 | 'type' => Controls_Manager::NUMBER, |
|---|
| 523 | 'min' => 1, |
|---|
| 524 | 'max' => 4, |
|---|
| 525 | 'step' => 1, |
|---|
| 526 | 'default' => 1, |
|---|
| 527 | 'condition' => [ |
|---|
| 528 | 'slider_on' => 'yes', |
|---|
| 529 | ] |
|---|
| 530 | ] |
|---|
| 531 | ); |
|---|
| 532 | |
|---|
| 533 | $this->add_control( |
|---|
| 534 | 'slmobile_width', |
|---|
| 535 | [ |
|---|
| 536 | 'label' => __('Mobile Resolution', 'htmega-addons'), |
|---|
| 537 | 'description' => __('The resolution to mobile.', 'htmega-addons'), |
|---|
| 538 | 'type' => Controls_Manager::NUMBER, |
|---|
| 539 | 'default' => 480, |
|---|
| 540 | 'condition' => [ |
|---|
| 541 | 'slider_on' => 'yes', |
|---|
| 542 | ] |
|---|
| 543 | ] |
|---|
| 544 | ); |
|---|
| 545 | |
|---|
| 546 | $this->end_controls_section(); // Slider Option end |
|---|
| 547 | // Style Slide Image |
|---|
| 548 | $this->start_controls_section( |
|---|
| 549 | 'post_carousel_image_style', |
|---|
| 550 | [ |
|---|
| 551 | 'label' => __( 'Carousel Item Style', 'htmega-addons' ), |
|---|
| 552 | 'tab' => Controls_Manager::TAB_STYLE, |
|---|
| 553 | ] |
|---|
| 554 | ); |
|---|
| 555 | $this->add_group_control( |
|---|
| 556 | Group_Control_Image_Size::get_type(), |
|---|
| 557 | [ 'name' => 'htmega_post_image', |
|---|
| 558 | 'default' => 'htmega_size_396x360', |
|---|
| 559 | 'separator' => 'before', |
|---|
| 560 | ] |
|---|
| 561 | ); |
|---|
| 562 | $this->add_responsive_control( |
|---|
| 563 | 'slider_height', |
|---|
| 564 | [ |
|---|
| 565 | 'label' => __( 'Item Min Height', 'htmega-addons' ), |
|---|
| 566 | 'type' => Controls_Manager::SLIDER, |
|---|
| 567 | 'description' =>'Custom Item height(px)', |
|---|
| 568 | 'size_units' => ['px'], |
|---|
| 569 | 'range' => [ |
|---|
| 570 | 'px' => [ |
|---|
| 571 | 'min' => 1, |
|---|
| 572 | 'max' => 1024, |
|---|
| 573 | 'step' => 1, |
|---|
| 574 | ], |
|---|
| 575 | ], |
|---|
| 576 | 'default' => [ |
|---|
| 577 | 'unit' => 'px', |
|---|
| 578 | ], |
|---|
| 579 | 'selectors' => [ |
|---|
| 580 | '{{WRAPPER}} .htmega-single-post-slide .thumb' => 'height: {{SIZE}}{{UNIT}};', |
|---|
| 581 | ], |
|---|
| 582 | ] |
|---|
| 583 | ); |
|---|
| 584 | $this->add_responsive_control( |
|---|
| 585 | 'items_radius', |
|---|
| 586 | [ |
|---|
| 587 | 'label' => esc_html__( 'Border Radius', 'htmega-addons' ), |
|---|
| 588 | 'type' => Controls_Manager::DIMENSIONS, |
|---|
| 589 | 'size_units' => [ 'px', '%', 'em' ], |
|---|
| 590 | 'selectors' => [ |
|---|
| 591 | '{{WRAPPER}} .htmega-single-post-slide .thumb a img,{{WRAPPER}} .htmega-single-post-slide .thumb a:after' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
|---|
| 592 | ], |
|---|
| 593 | 'separator' => 'before', |
|---|
| 594 | ] |
|---|
| 595 | ); |
|---|
| 596 | $this->add_control( |
|---|
| 597 | 'post_carousel_image_overlay_heading', |
|---|
| 598 | [ |
|---|
| 599 | 'label' => __( 'Image Overlay', 'htmega-addons' ), |
|---|
| 600 | 'type' => Controls_Manager::HEADING, |
|---|
| 601 | 'separator' => 'before', |
|---|
| 602 | ] |
|---|
| 603 | ); |
|---|
| 604 | $this->add_group_control( |
|---|
| 605 | Group_Control_Background::get_type(), |
|---|
| 606 | [ |
|---|
| 607 | 'name' => 'post_slider_image_overlay', |
|---|
| 608 | 'label' => __( 'Background', 'htmega-addons' ), |
|---|
| 609 | 'types' => [ 'classic', 'gradient' ], |
|---|
| 610 | 'selector' => '{{WRAPPER}} .htmega-single-post-slide .thumb a:after', |
|---|
| 611 | 'separator' => 'after', |
|---|
| 612 | ] |
|---|
| 613 | ); |
|---|
| 614 | $this->add_control( |
|---|
| 615 | 'image_overlay_heading_hover', |
|---|
| 616 | [ |
|---|
| 617 | 'label' => __( 'Image Hover Overlay', 'htmega-addons' ), |
|---|
| 618 | 'type' => Controls_Manager::HEADING, |
|---|
| 619 | 'separator' => 'before', |
|---|
| 620 | 'condition'=>[ |
|---|
| 621 | 'post_carousel_style' =>'3', |
|---|
| 622 | ] |
|---|
| 623 | ] |
|---|
| 624 | ); |
|---|
| 625 | $this->add_group_control( |
|---|
| 626 | Group_Control_Background::get_type(), |
|---|
| 627 | [ |
|---|
| 628 | 'name' => 'post_slider_image_overlay_hover', |
|---|
| 629 | 'label' => __( 'Background', 'htmega-addons' ), |
|---|
| 630 | 'types' => [ 'classic', 'gradient' ], |
|---|
| 631 | 'selector' => '{{WRAPPER}} .htmega-single-post-slide .thumb a:before', |
|---|
| 632 | 'separator' => 'after', |
|---|
| 633 | 'condition'=>[ |
|---|
| 634 | 'post_carousel_style' =>'3', |
|---|
| 635 | ] |
|---|
| 636 | ] |
|---|
| 637 | ); |
|---|
| 638 | |
|---|
| 639 | // Content box style start |
|---|
| 640 | $this->add_control( |
|---|
| 641 | 'content_box_heading', |
|---|
| 642 | [ |
|---|
| 643 | 'label' => __( 'Content Box Style', 'htmega-addons' ), |
|---|
| 644 | 'type' => Controls_Manager::HEADING, |
|---|
| 645 | 'separator' => 'before', |
|---|
| 646 | ] |
|---|
| 647 | ); |
|---|
| 648 | $this->add_group_control( |
|---|
| 649 | Group_Control_Background::get_type(), |
|---|
| 650 | [ |
|---|
| 651 | 'name' => 'content_box_background', |
|---|
| 652 | 'label' => __( 'Background', 'htmega-addons' ), |
|---|
| 653 | 'types' => [ 'classic', 'gradient' ], |
|---|
| 654 | 'selector' => '{{WRAPPER}} .post-carousel-wrapper .htmega-postslider-layout-1 .content .post-inner, {{WRAPPER}} .post-carousel-wrapper .htmega-postslider-layout-2 .content .post-inner,{{WRAPPER}} .post-carousel-wrapper .htmega-postslider-layout-4 .content,{{WRAPPER}} .post-carousel-wrapper .htmega-postslider-layout-5 .content .post-inner', |
|---|
| 655 | 'separator' => 'before', |
|---|
| 656 | 'condition'=>[ |
|---|
| 657 | 'post_carousel_style!' =>'3', |
|---|
| 658 | ] |
|---|
| 659 | ] |
|---|
| 660 | ); |
|---|
| 661 | // Content box hover bg |
|---|
| 662 | $this->add_control( |
|---|
| 663 | 'content_box_hover_heading', |
|---|
| 664 | [ |
|---|
| 665 | 'label' => __( 'Content Box Hover BG', 'htmega-addons' ), |
|---|
| 666 | 'type' => Controls_Manager::HEADING, |
|---|
| 667 | 'separator' => 'before', |
|---|
| 668 | 'condition'=>[ |
|---|
| 669 | 'post_carousel_style' =>'1', |
|---|
| 670 | ] |
|---|
| 671 | ] |
|---|
| 672 | ); |
|---|
| 673 | $this->add_group_control( |
|---|
| 674 | Group_Control_Background::get_type(), |
|---|
| 675 | [ |
|---|
| 676 | 'name' => 'content_box_background_hover', |
|---|
| 677 | 'label' => __( 'Background', 'htmega-addons' ), |
|---|
| 678 | 'types' => [ 'classic', 'gradient' ], |
|---|
| 679 | 'selector' => '{{WRAPPER}} .post-carousel-wrapper .htmega-postslider-layout-1:hover .content .post-inner', |
|---|
| 680 | 'condition'=>[ |
|---|
| 681 | 'post_carousel_style' =>'1', |
|---|
| 682 | ] |
|---|
| 683 | ] |
|---|
| 684 | ); |
|---|
| 685 | $this->add_responsive_control( |
|---|
| 686 | 'content_box_margin', |
|---|
| 687 | [ |
|---|
| 688 | 'label' => __( 'Margin', 'htmega-addons' ), |
|---|
| 689 | 'type' => Controls_Manager::DIMENSIONS, |
|---|
| 690 | 'size_units' => [ 'px', '%', 'em' ], |
|---|
| 691 | 'selectors' => [ |
|---|
| 692 | '{{WRAPPER}} .htmega-postslider-layout-5 .content,{{WRAPPER}} .post-carousel-wrapper .htmega-postslider-layout-2 .content,{{WRAPPER}} .post-carousel-wrapper .htmega-postslider-layout-4 .content,{{WRAPPER}} .post-carousel-wrapper .htmega-postslider-layout-5 .content' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
|---|
| 693 | '{{WRAPPER}} .post-carousel-wrapper .htmega-postslider-layout-2 .content' => 'padding-left: {{LEFT}}{{UNIT}}; padding-right: {{RIGHT}}{{UNIT}};', |
|---|
| 694 | ], |
|---|
| 695 | 'separator' => 'before', |
|---|
| 696 | 'condition'=>[ |
|---|
| 697 | 'post_carousel_style!' =>['1','3'], |
|---|
| 698 | ] |
|---|
| 699 | ] |
|---|
| 700 | ); |
|---|
| 701 | $this->add_responsive_control( |
|---|
| 702 | 'content_box_padding', |
|---|
| 703 | [ |
|---|
| 704 | 'label' => __( 'Padding', 'htmega-addons' ), |
|---|
| 705 | 'type' => Controls_Manager::DIMENSIONS, |
|---|
| 706 | 'size_units' => [ 'px', '%', 'em' ], |
|---|
| 707 | 'selectors' => [ |
|---|
| 708 | '{{WRAPPER}} .post-carousel-wrapper .htmega-postslider-layout-1 .content .post-inner,{{WRAPPER}} .post-carousel-wrapper .htmega-postslider-layout-2 .content .post-inner,{{WRAPPER}} .htmega-postslider-layout-3 .content .post-inner, {{WRAPPER}} .post-carousel-wrapper .htmega-postslider-layout-4 .content, {{WRAPPER}} .post-carousel-wrapper .htmega-postslider-layout-5 .content .post-inner' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
|---|
| 709 | ], |
|---|
| 710 | 'separator' => 'before', |
|---|
| 711 | ] |
|---|
| 712 | ); |
|---|
| 713 | |
|---|
| 714 | $this->add_group_control( |
|---|
| 715 | Group_Control_Border::get_type(), |
|---|
| 716 | [ |
|---|
| 717 | 'name' => 'content_box_border', |
|---|
| 718 | 'label' => __( 'Border', 'htmega-addons' ), |
|---|
| 719 | 'selector' => '{{WRAPPER}} .post-carousel-wrapper .htmega-postslider-layout-1 .content .post-inner,{{WRAPPER}} .post-carousel-wrapper .htmega-postslider-layout-5 .content .post-inner', |
|---|
| 720 | 'separator' => 'before', |
|---|
| 721 | 'condition'=>[ |
|---|
| 722 | 'post_carousel_style!' =>['3','4','2'], |
|---|
| 723 | ] |
|---|
| 724 | ] |
|---|
| 725 | ); |
|---|
| 726 | $this->add_responsive_control( |
|---|
| 727 | 'content_box_border_radius', |
|---|
| 728 | [ |
|---|
| 729 | 'label' => esc_html__( 'Border Radius', 'htmega-addons' ), |
|---|
| 730 | 'type' => Controls_Manager::DIMENSIONS, |
|---|
| 731 | 'size_units' => [ 'px', '%', 'em' ], |
|---|
| 732 | 'selectors' => [ |
|---|
| 733 | '{{WRAPPER}} .post-carousel-wrapper .htmega-postslider-layout-1 .content .post-inner,{{WRAPPER}} .post-carousel-wrapper .htmega-postslider-layout-2 .content .post-inner,{{WRAPPER}} .post-carousel-wrapper .htmega-postslider-layout-4 .content,{{WRAPPER}} .post-carousel-wrapper .htmega-postslider-layout-5 .content .post-inner' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
|---|
| 734 | ], |
|---|
| 735 | 'separator' => 'before', |
|---|
| 736 | 'condition'=>[ |
|---|
| 737 | 'post_carousel_style!' =>'3', |
|---|
| 738 | ] |
|---|
| 739 | ] |
|---|
| 740 | ); |
|---|
| 741 | |
|---|
| 742 | $this->add_responsive_control( |
|---|
| 743 | 'post_slider_content_box_align', |
|---|
| 744 | [ |
|---|
| 745 | 'label' => __( 'Alignment', 'htmega-addons' ), |
|---|
| 746 | 'type' => Controls_Manager::CHOOSE, |
|---|
| 747 | 'options' => [ |
|---|
| 748 | 'left' => [ |
|---|
| 749 | 'title' => __( 'Left', 'htmega-addons' ), |
|---|
| 750 | 'icon' => 'eicon-text-align-left', |
|---|
| 751 | ], |
|---|
| 752 | 'center' => [ |
|---|
| 753 | 'title' => __( 'Center', 'htmega-addons' ), |
|---|
| 754 | 'icon' => 'eicon-text-align-center', |
|---|
| 755 | ], |
|---|
| 756 | 'right' => [ |
|---|
| 757 | 'title' => __( 'Right', 'htmega-addons' ), |
|---|
| 758 | 'icon' => 'eicon-text-align-right', |
|---|
| 759 | ], |
|---|
| 760 | ], |
|---|
| 761 | 'selectors' => [ |
|---|
| 762 | '{{WRAPPER}} .post-carousel-wrapper .htmega-postslider-layout-1 .content .post-inner,{{WRAPPER}} .post-carousel-wrapper .htmega-postslider-layout-2 .content .post-inner,{{WRAPPER}} .post-carousel-wrapper .htmega-postslider-layout-4 .content .post-inner, {{WRAPPER}} .post-carousel-wrapper .htmega-postslider-layout-5 .content .post-inner, {{WRAPPER}} .htmega-postslider-layout-3 .content' => 'text-align: {{VALUE}};', |
|---|
| 763 | ], |
|---|
| 764 | ] |
|---|
| 765 | ); |
|---|
| 766 | |
|---|
| 767 | $this->add_group_control( |
|---|
| 768 | Group_Control_Box_Shadow::get_type(), |
|---|
| 769 | [ |
|---|
| 770 | 'name' => 'content_boxshadow', |
|---|
| 771 | 'label' => __( 'Box Shadow', 'htmega-addons' ), |
|---|
| 772 | 'selector' => '{{WRAPPER}} .post-carousel-wrapper .htmega-postslider-layout-2 .content .post-inner,{{WRAPPER}} .post-carousel-wrapper .htmega-postslider-layout-4 .content,{{WRAPPER}} .post-carousel-wrapper .htmega-postslider-layout-5 .content .post-inner', |
|---|
| 773 | 'condition'=>[ |
|---|
| 774 | 'post_carousel_style!' =>['1','3'], |
|---|
| 775 | ] |
|---|
| 776 | ] |
|---|
| 777 | ); |
|---|
| 778 | |
|---|
| 779 | $this->end_controls_section(); |
|---|
| 780 | //Slider Image Style end |
|---|
| 781 | |
|---|
| 782 | $this->start_controls_section( |
|---|
| 783 | 'post_slider_content_border', |
|---|
| 784 | [ |
|---|
| 785 | 'label' => __( 'Content Box Bottom Border', 'htmega-addons' ), |
|---|
| 786 | 'tab' => Controls_Manager::TAB_STYLE, |
|---|
| 787 | 'condition' => [ |
|---|
| 788 | 'post_carousel_style' => '2', |
|---|
| 789 | ] |
|---|
| 790 | ] |
|---|
| 791 | ); |
|---|
| 792 | $this->add_control( |
|---|
| 793 | 'border_type', |
|---|
| 794 | [ |
|---|
| 795 | 'label' => esc_html__( 'Border Type', 'htmega-addons' ), |
|---|
| 796 | 'type' => Controls_Manager::SELECT, |
|---|
| 797 | 'default' => 'htmega-solid', |
|---|
| 798 | 'options' => [ |
|---|
| 799 | 'htmega-solid' => esc_html__('Solid Color','htmega-addons'), |
|---|
| 800 | 'htmega-gradient' => esc_html__('Gradient Color','htmega-addons'), |
|---|
| 801 | ], |
|---|
| 802 | |
|---|
| 803 | ] |
|---|
| 804 | ); |
|---|
| 805 | |
|---|
| 806 | $this->add_control( |
|---|
| 807 | 'post_slider_content_border_color', |
|---|
| 808 | [ |
|---|
| 809 | 'label' => __( 'Border Color', 'htmega-addons' ), |
|---|
| 810 | 'type' => Controls_Manager::COLOR, |
|---|
| 811 | 'default'=>'#b5b5b5', |
|---|
| 812 | 'selectors' => [ |
|---|
| 813 | '{{WRAPPER}} .post-carousel-wrapper .htmega-postslider-layout-2 .content .post-inner' => 'border-color: {{VALUE}}', |
|---|
| 814 | ], |
|---|
| 815 | 'condition' => [ |
|---|
| 816 | 'border_type' => 'htmega-solid', |
|---|
| 817 | ] |
|---|
| 818 | ] |
|---|
| 819 | ); |
|---|
| 820 | |
|---|
| 821 | $this->add_control( |
|---|
| 822 | 'post_slider_content_hover_border_color', |
|---|
| 823 | [ |
|---|
| 824 | 'label' => __( 'Hover Border Color', 'htmega-addons' ), |
|---|
| 825 | 'type' => Controls_Manager::COLOR, |
|---|
| 826 | 'default'=>'#0056ff', |
|---|
| 827 | 'selectors' => [ |
|---|
| 828 | '{{WRAPPER}} .post-carousel-wrapper .htmega-postslider-layout-2:hover .content .post-inner' => 'border-color: {{VALUE}}', |
|---|
| 829 | ], |
|---|
| 830 | 'condition' => [ |
|---|
| 831 | 'border_type' => 'htmega-solid', |
|---|
| 832 | ] |
|---|
| 833 | ] |
|---|
| 834 | ); |
|---|
| 835 | $this->add_control( |
|---|
| 836 | 'border_gradient_bg_title', |
|---|
| 837 | [ |
|---|
| 838 | 'label' => __( 'Border Gradient Color', 'htmega-addons' ), |
|---|
| 839 | 'type' => Controls_Manager::HEADING, |
|---|
| 840 | 'separator' => 'before', |
|---|
| 841 | 'condition' => [ |
|---|
| 842 | 'border_type' => 'htmega-gradient', |
|---|
| 843 | ] |
|---|
| 844 | ] |
|---|
| 845 | ); |
|---|
| 846 | $this->add_group_control( |
|---|
| 847 | Group_Control_Background::get_type(), |
|---|
| 848 | [ |
|---|
| 849 | 'name' => 'border_gradient_bg', |
|---|
| 850 | 'label' => __( 'Background', 'htmega-addons' ), |
|---|
| 851 | 'types' => [ 'classic', 'gradient' ], |
|---|
| 852 | 'selector' => '{{WRAPPER}} .post-carousel-wrapper .htmega-postslider-layout-2 .content .post-inner:after', |
|---|
| 853 | 'condition' => [ |
|---|
| 854 | 'border_type' => 'htmega-gradient', |
|---|
| 855 | ] |
|---|
| 856 | ] |
|---|
| 857 | ); |
|---|
| 858 | $this->add_control( |
|---|
| 859 | 'border_gradient_bg_title_hover', |
|---|
| 860 | [ |
|---|
| 861 | 'label' => __( 'Border Hover Gradient Color', 'htmega-addons' ), |
|---|
| 862 | 'type' => Controls_Manager::HEADING, |
|---|
| 863 | 'separator' => 'before', |
|---|
| 864 | 'condition' => [ |
|---|
| 865 | 'border_type' => 'htmega-gradient', |
|---|
| 866 | ] |
|---|
| 867 | ] |
|---|
| 868 | ); |
|---|
| 869 | $this->add_group_control( |
|---|
| 870 | Group_Control_Background::get_type(), |
|---|
| 871 | [ |
|---|
| 872 | 'name' => 'border_gradient_bg_hover', |
|---|
| 873 | 'label' => __( 'Background', 'htmega-addons' ), |
|---|
| 874 | 'types' => [ 'classic', 'gradient' ], |
|---|
| 875 | 'selector' => '{{WRAPPER}} .post-carousel-wrapper .htmega-postslider-layout-2:hover .content .post-inner:after', |
|---|
| 876 | 'condition' => [ |
|---|
| 877 | 'border_type' => 'htmega-gradient', |
|---|
| 878 | ] |
|---|
| 879 | ] |
|---|
| 880 | ); |
|---|
| 881 | |
|---|
| 882 | $this->end_controls_section(); // Slider Option end |
|---|
| 883 | |
|---|
| 884 | // Style Title tab section |
|---|
| 885 | $this->start_controls_section( |
|---|
| 886 | 'post_slider_title_style_section', |
|---|
| 887 | [ |
|---|
| 888 | 'label' => __( 'Title', 'htmega-addons' ), |
|---|
| 889 | 'tab' => Controls_Manager::TAB_STYLE, |
|---|
| 890 | 'condition'=>[ |
|---|
| 891 | 'show_title'=>'yes', |
|---|
| 892 | ] |
|---|
| 893 | ] |
|---|
| 894 | ); |
|---|
| 895 | $this->add_control( |
|---|
| 896 | 'title_color', |
|---|
| 897 | [ |
|---|
| 898 | 'label' => __( 'Color', 'htmega-addons' ), |
|---|
| 899 | 'type' => Controls_Manager::COLOR, |
|---|
| 900 | 'default'=>'#18012c', |
|---|
| 901 | 'selectors' => [ |
|---|
| 902 | '{{WRAPPER}} .htmega-single-post-slide .content .post-inner h2 a' => 'color: {{VALUE}}', |
|---|
| 903 | ], |
|---|
| 904 | ] |
|---|
| 905 | ); |
|---|
| 906 | $this->add_control( |
|---|
| 907 | 'title_color_hover', |
|---|
| 908 | [ |
|---|
| 909 | 'label' => __( 'Hover Color', 'htmega-addons' ), |
|---|
| 910 | 'type' => Controls_Manager::COLOR, |
|---|
| 911 | 'selectors' => [ |
|---|
| 912 | '{{WRAPPER}} .htmega-single-post-slide .content .post-inner h2 a:hover' => 'color: {{VALUE}}', |
|---|
| 913 | ], |
|---|
| 914 | ] |
|---|
| 915 | ); |
|---|
| 916 | |
|---|
| 917 | $this->add_group_control( |
|---|
| 918 | Group_Control_Typography::get_type(), |
|---|
| 919 | [ |
|---|
| 920 | 'name' => 'title_typography', |
|---|
| 921 | 'label' => __( 'Typography', 'htmega-addons' ), |
|---|
| 922 | 'selector' => '{{WRAPPER}} .htmega-single-post-slide .content .post-inner h2', |
|---|
| 923 | ] |
|---|
| 924 | ); |
|---|
| 925 | |
|---|
| 926 | $this->add_responsive_control( |
|---|
| 927 | 'title_margin', |
|---|
| 928 | [ |
|---|
| 929 | 'label' => __( 'Margin', 'htmega-addons' ), |
|---|
| 930 | 'type' => Controls_Manager::DIMENSIONS, |
|---|
| 931 | 'size_units' => [ 'px', '%', 'em' ], |
|---|
| 932 | 'selectors' => [ |
|---|
| 933 | '{{WRAPPER}} .htmega-single-post-slide .content .post-inner h2' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
|---|
| 934 | ], |
|---|
| 935 | ] |
|---|
| 936 | ); |
|---|
| 937 | |
|---|
| 938 | $this->add_responsive_control( |
|---|
| 939 | 'title_padding', |
|---|
| 940 | [ |
|---|
| 941 | 'label' => __( 'Padding', 'htmega-addons' ), |
|---|
| 942 | 'type' => Controls_Manager::DIMENSIONS, |
|---|
| 943 | 'size_units' => [ 'px', '%', 'em' ], |
|---|
| 944 | 'selectors' => [ |
|---|
| 945 | '{{WRAPPER}} .htmega-single-post-slide .content .post-inner h2' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
|---|
| 946 | ], |
|---|
| 947 | ] |
|---|
| 948 | ); |
|---|
| 949 | |
|---|
| 950 | $this->add_responsive_control( |
|---|
| 951 | 'title_align', |
|---|
| 952 | [ |
|---|
| 953 | 'label' => __( 'Alignment', 'htmega-addons' ), |
|---|
| 954 | 'type' => Controls_Manager::CHOOSE, |
|---|
| 955 | 'options' => [ |
|---|
| 956 | 'left' => [ |
|---|
| 957 | 'title' => __( 'Left', 'htmega-addons' ), |
|---|
| 958 | 'icon' => 'eicon-text-align-left', |
|---|
| 959 | ], |
|---|
| 960 | 'center' => [ |
|---|
| 961 | 'title' => __( 'Center', 'htmega-addons' ), |
|---|
| 962 | 'icon' => 'eicon-text-align-center', |
|---|
| 963 | ], |
|---|
| 964 | 'right' => [ |
|---|
| 965 | 'title' => __( 'Right', 'htmega-addons' ), |
|---|
| 966 | 'icon' => 'eicon-text-align-right', |
|---|
| 967 | ], |
|---|
| 968 | 'justify' => [ |
|---|
| 969 | 'title' => __( 'Justified', 'htmega-addons' ), |
|---|
| 970 | 'icon' => 'eicon-text-align-justify', |
|---|
| 971 | ], |
|---|
| 972 | ], |
|---|
| 973 | 'selectors' => [ |
|---|
| 974 | '{{WRAPPER}} .htmega-single-post-slide .content .post-inner h2' => 'text-align: {{VALUE}};', |
|---|
| 975 | ], |
|---|
| 976 | ] |
|---|
| 977 | ); |
|---|
| 978 | |
|---|
| 979 | $this->end_controls_section(); |
|---|
| 980 | |
|---|
| 981 | // Style Content tab section |
|---|
| 982 | $this->start_controls_section( |
|---|
| 983 | 'post_slider_content_style_section', |
|---|
| 984 | [ |
|---|
| 985 | 'label' => __( 'Content', 'htmega-addons' ), |
|---|
| 986 | 'tab' => Controls_Manager::TAB_STYLE, |
|---|
| 987 | 'condition'=>[ |
|---|
| 988 | 'show_content'=>'yes', |
|---|
| 989 | ] |
|---|
| 990 | ] |
|---|
| 991 | ); |
|---|
| 992 | $this->add_control( |
|---|
| 993 | 'content_color', |
|---|
| 994 | [ |
|---|
| 995 | 'label' => __( 'Color', 'htmega-addons' ), |
|---|
| 996 | 'type' => Controls_Manager::COLOR, |
|---|
| 997 | 'default'=>'#18012c', |
|---|
| 998 | 'selectors' => [ |
|---|
| 999 | '{{WRAPPER}} .htmega-single-post-slide .content .post-inner p' => 'color: {{VALUE}}', |
|---|
| 1000 | ], |
|---|
| 1001 | ] |
|---|
| 1002 | ); |
|---|
| 1003 | |
|---|
| 1004 | $this->add_group_control( |
|---|
| 1005 | Group_Control_Typography::get_type(), |
|---|
| 1006 | [ |
|---|
| 1007 | 'name' => 'content_typography', |
|---|
| 1008 | 'label' => __( 'Typography', 'htmega-addons' ), |
|---|
| 1009 | 'selector' => '{{WRAPPER}} .htmega-single-post-slide .content .post-inner p', |
|---|
| 1010 | ] |
|---|
| 1011 | ); |
|---|
| 1012 | |
|---|
| 1013 | $this->add_responsive_control( |
|---|
| 1014 | 'content_margin', |
|---|
| 1015 | [ |
|---|
| 1016 | 'label' => __( 'Margin', 'htmega-addons' ), |
|---|
| 1017 | 'type' => Controls_Manager::DIMENSIONS, |
|---|
| 1018 | 'size_units' => [ 'px', '%', 'em' ], |
|---|
| 1019 | 'selectors' => [ |
|---|
| 1020 | '{{WRAPPER}} .htmega-single-post-slide .content .post-inner p' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
|---|
| 1021 | ], |
|---|
| 1022 | ] |
|---|
| 1023 | ); |
|---|
| 1024 | |
|---|
| 1025 | $this->add_responsive_control( |
|---|
| 1026 | 'content_padding', |
|---|
| 1027 | [ |
|---|
| 1028 | 'label' => __( 'Padding', 'htmega-addons' ), |
|---|
| 1029 | 'type' => Controls_Manager::DIMENSIONS, |
|---|
| 1030 | 'size_units' => [ 'px', '%', 'em' ], |
|---|
| 1031 | 'selectors' => [ |
|---|
| 1032 | '{{WRAPPER}} .htmega-single-post-slide .content .post-inner p' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
|---|
| 1033 | ], |
|---|
| 1034 | ] |
|---|
| 1035 | ); |
|---|
| 1036 | |
|---|
| 1037 | $this->add_responsive_control( |
|---|
| 1038 | 'content_align', |
|---|
| 1039 | [ |
|---|
| 1040 | 'label' => __( 'Alignment', 'htmega-addons' ), |
|---|
| 1041 | 'type' => Controls_Manager::CHOOSE, |
|---|
| 1042 | 'options' => [ |
|---|
| 1043 | 'left' => [ |
|---|
| 1044 | 'title' => __( 'Left', 'htmega-addons' ), |
|---|
| 1045 | 'icon' => 'eicon-text-align-left', |
|---|
| 1046 | ], |
|---|
| 1047 | 'center' => [ |
|---|
| 1048 | 'title' => __( 'Center', 'htmega-addons' ), |
|---|
| 1049 | 'icon' => 'eicon-text-align-center', |
|---|
| 1050 | ], |
|---|
| 1051 | 'right' => [ |
|---|
| 1052 | 'title' => __( 'Right', 'htmega-addons' ), |
|---|
| 1053 | 'icon' => 'eicon-text-align-right', |
|---|
| 1054 | ], |
|---|
| 1055 | 'justify' => [ |
|---|
| 1056 | 'title' => __( 'Justified', 'htmega-addons' ), |
|---|
| 1057 | 'icon' => 'eicon-text-align-justify', |
|---|
| 1058 | ], |
|---|
| 1059 | ], |
|---|
| 1060 | 'selectors' => [ |
|---|
| 1061 | '{{WRAPPER}} .htmega-single-post-slide .content .post-inner p' => 'text-align: {{VALUE}};', |
|---|
| 1062 | ], |
|---|
| 1063 | ] |
|---|
| 1064 | ); |
|---|
| 1065 | |
|---|
| 1066 | $this->end_controls_section(); |
|---|
| 1067 | |
|---|
| 1068 | //style thumbnail opacity section |
|---|
| 1069 | $this->start_controls_section( |
|---|
| 1070 | 'post_thumbnail_opacity_section', |
|---|
| 1071 | [ |
|---|
| 1072 | 'label' => __( 'Thumbnail', 'htmega-addons' ), |
|---|
| 1073 | 'tab' => Controls_Manager::TAB_STYLE, |
|---|
| 1074 | 'condition'=>[ |
|---|
| 1075 | 'post_carousel_style'=>'3', |
|---|
| 1076 | ] |
|---|
| 1077 | ] |
|---|
| 1078 | ); |
|---|
| 1079 | |
|---|
| 1080 | $this->add_control( |
|---|
| 1081 | 'post_thumbnail_opacity_color', |
|---|
| 1082 | [ |
|---|
| 1083 | 'label' => esc_html__( 'Opacity Color', 'htmega-addons' ), |
|---|
| 1084 | 'type' => Controls_Manager::COLOR, |
|---|
| 1085 | 'selectors' => [ |
|---|
| 1086 | '{{WRAPPER}} .htmega-postslider-layout-3 .thumb:before' => 'content: ""; background: {{VALUE}}; width: 100%; height: 100%; position: absolute; z-index:1;', |
|---|
| 1087 | ] |
|---|
| 1088 | ] |
|---|
| 1089 | ); |
|---|
| 1090 | |
|---|
| 1091 | $this->add_control( |
|---|
| 1092 | 'post_thumbnail_opacity_opacity', |
|---|
| 1093 | [ |
|---|
| 1094 | 'label' => __( 'Opacity (%)', 'htmega-addons' ), |
|---|
| 1095 | 'type' => Controls_Manager::SLIDER, |
|---|
| 1096 | 'default' => [ |
|---|
| 1097 | 'size' => 0.8, |
|---|
| 1098 | ], |
|---|
| 1099 | 'range' => [ |
|---|
| 1100 | 'px' => [ |
|---|
| 1101 | 'max' => 1, |
|---|
| 1102 | 'min' => 0.10, |
|---|
| 1103 | 'step' => 0.01, |
|---|
| 1104 | ], |
|---|
| 1105 | ], |
|---|
| 1106 | 'selectors' => [ |
|---|
| 1107 | '{{WRAPPER}} .htmega-postslider-layout-3 .thumb:before' => 'opacity: {{SIZE}};', |
|---|
| 1108 | ] |
|---|
| 1109 | ] |
|---|
| 1110 | ); |
|---|
| 1111 | |
|---|
| 1112 | $this->end_controls_section(); |
|---|
| 1113 | |
|---|
| 1114 | // Style Category tab section |
|---|
| 1115 | $this->start_controls_section( |
|---|
| 1116 | 'post_slider_category_style_section', |
|---|
| 1117 | [ |
|---|
| 1118 | 'label' => __( 'Category', 'htmega-addons' ), |
|---|
| 1119 | 'tab' => Controls_Manager::TAB_STYLE, |
|---|
| 1120 | 'condition'=>[ |
|---|
| 1121 | 'show_category'=>'yes', |
|---|
| 1122 | ] |
|---|
| 1123 | ] |
|---|
| 1124 | ); |
|---|
| 1125 | |
|---|
| 1126 | $this->start_controls_tabs('category_style_tabs'); |
|---|
| 1127 | |
|---|
| 1128 | $this->start_controls_tab( |
|---|
| 1129 | 'category_style_normal_tab', |
|---|
| 1130 | [ |
|---|
| 1131 | 'label' => __( 'Normal', 'htmega-addons' ), |
|---|
| 1132 | ] |
|---|
| 1133 | ); |
|---|
| 1134 | |
|---|
| 1135 | $this->add_control( |
|---|
| 1136 | 'category_color', |
|---|
| 1137 | [ |
|---|
| 1138 | 'label' => __( 'Color', 'htmega-addons' ), |
|---|
| 1139 | 'type' => Controls_Manager::COLOR, |
|---|
| 1140 | 'default'=>'#ffffff', |
|---|
| 1141 | 'selectors' => [ |
|---|
| 1142 | '{{WRAPPER}} .htmega-single-post-slide .content ul.post-category li a' => 'color: {{VALUE}}', |
|---|
| 1143 | ], |
|---|
| 1144 | ] |
|---|
| 1145 | ); |
|---|
| 1146 | |
|---|
| 1147 | $this->add_group_control( |
|---|
| 1148 | Group_Control_Typography::get_type(), |
|---|
| 1149 | [ |
|---|
| 1150 | 'name' => 'category_typography', |
|---|
| 1151 | 'label' => __( 'Typography', 'htmega-addons' ), |
|---|
| 1152 | 'selector' => '{{WRAPPER}} .htmega-single-post-slide .content ul.post-category li a', |
|---|
| 1153 | ] |
|---|
| 1154 | ); |
|---|
| 1155 | |
|---|
| 1156 | $this->add_responsive_control( |
|---|
| 1157 | 'category_margin', |
|---|
| 1158 | [ |
|---|
| 1159 | 'label' => __( 'Margin', 'htmega-addons' ), |
|---|
| 1160 | 'type' => Controls_Manager::DIMENSIONS, |
|---|
| 1161 | 'size_units' => [ 'px', '%', 'em' ], |
|---|
| 1162 | 'selectors' => [ |
|---|
| 1163 | '{{WRAPPER}} .htmega-single-post-slide .content ul.post-category li' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
|---|
| 1164 | ], |
|---|
| 1165 | ] |
|---|
| 1166 | ); |
|---|
| 1167 | |
|---|
| 1168 | $this->add_responsive_control( |
|---|
| 1169 | 'category_padding', |
|---|
| 1170 | [ |
|---|
| 1171 | 'label' => __( 'Padding', 'htmega-addons' ), |
|---|
| 1172 | 'type' => Controls_Manager::DIMENSIONS, |
|---|
| 1173 | 'size_units' => [ 'px', '%', 'em' ], |
|---|
| 1174 | 'selectors' => [ |
|---|
| 1175 | '{{WRAPPER}} .htmega-single-post-slide .content ul.post-category li a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
|---|
| 1176 | ], |
|---|
| 1177 | ] |
|---|
| 1178 | ); |
|---|
| 1179 | |
|---|
| 1180 | $this->add_group_control( |
|---|
| 1181 | Group_Control_Background::get_type(), |
|---|
| 1182 | [ |
|---|
| 1183 | 'name' => 'category_background', |
|---|
| 1184 | 'label' => __( 'Background', 'htmega-addons' ), |
|---|
| 1185 | 'types' => [ 'classic', 'gradient' ], |
|---|
| 1186 | 'selector' => '{{WRAPPER}} .htmega-single-post-slide .content ul.post-category li a', |
|---|
| 1187 | ] |
|---|
| 1188 | ); |
|---|
| 1189 | |
|---|
| 1190 | $this->end_controls_tab(); // Normal Tab end |
|---|
| 1191 | |
|---|
| 1192 | $this->start_controls_tab( |
|---|
| 1193 | 'category_style_hover_tab', |
|---|
| 1194 | [ |
|---|
| 1195 | 'label' => __( 'Hover', 'htmega-addons' ), |
|---|
| 1196 | ] |
|---|
| 1197 | ); |
|---|
| 1198 | $this->add_control( |
|---|
| 1199 | 'category_hover_color', |
|---|
| 1200 | [ |
|---|
| 1201 | 'label' => __( 'Color', 'htmega-addons' ), |
|---|
| 1202 | 'type' => Controls_Manager::COLOR, |
|---|
| 1203 | 'default'=>'#ffffff', |
|---|
| 1204 | 'selectors' => [ |
|---|
| 1205 | '{{WRAPPER}} .htmega-single-post-slide .content ul.post-category li a:hover' => 'color: {{VALUE}}', |
|---|
| 1206 | ], |
|---|
| 1207 | ] |
|---|
| 1208 | ); |
|---|
| 1209 | |
|---|
| 1210 | $this->add_group_control( |
|---|
| 1211 | Group_Control_Background::get_type(), |
|---|
| 1212 | [ |
|---|
| 1213 | 'name' => 'category_hover_background', |
|---|
| 1214 | 'label' => __( 'Background', 'htmega-addons' ), |
|---|
| 1215 | 'types' => [ 'classic', 'gradient' ], |
|---|
| 1216 | 'selector' => '{{WRAPPER}} .htmega-single-post-slide .content ul.post-category li a:hover', |
|---|
| 1217 | ] |
|---|
| 1218 | ); |
|---|
| 1219 | |
|---|
| 1220 | $this->end_controls_tab(); // Hover Tab end |
|---|
| 1221 | |
|---|
| 1222 | $this->end_controls_tabs(); |
|---|
| 1223 | |
|---|
| 1224 | $this->end_controls_section(); |
|---|
| 1225 | |
|---|
| 1226 | // Style Meta tab section |
|---|
| 1227 | $this->start_controls_section( |
|---|
| 1228 | 'post_meta_style_section', |
|---|
| 1229 | [ |
|---|
| 1230 | 'label' => __( 'Meta', 'htmega-addons' ), |
|---|
| 1231 | 'tab' => Controls_Manager::TAB_STYLE, |
|---|
| 1232 | ] |
|---|
| 1233 | ); |
|---|
| 1234 | $this->add_control( |
|---|
| 1235 | 'meta_color', |
|---|
| 1236 | [ |
|---|
| 1237 | 'label' => __( 'Color', 'htmega-addons' ), |
|---|
| 1238 | 'type' => Controls_Manager::COLOR, |
|---|
| 1239 | 'default'=>'#18012c', |
|---|
| 1240 | 'selectors' => [ |
|---|
| 1241 | '{{WRAPPER}} .post-carousel-wrapper .htmega-single-post-slide ul.meta li' => 'color: {{VALUE}}', |
|---|
| 1242 | '{{WRAPPER}} .post-carousel-wrapper .htmega-single-post-slide .content .post-inner ul.meta li a' => 'color: {{VALUE}}', |
|---|
| 1243 | ], |
|---|
| 1244 | ] |
|---|
| 1245 | ); |
|---|
| 1246 | $this->add_control( |
|---|
| 1247 | 'meta_color_icon', |
|---|
| 1248 | [ |
|---|
| 1249 | 'label' => __( 'Icon Color', 'htmega-addons' ), |
|---|
| 1250 | 'type' => Controls_Manager::COLOR, |
|---|
| 1251 | 'selectors' => [ |
|---|
| 1252 | '{{WRAPPER}} .post-carousel-wrapper .htmega-single-post-slide ul.meta li i' => 'color: {{VALUE}}', |
|---|
| 1253 | '{{WRAPPER}} .post-carousel-wrapper .htmega-single-post-slide .content .post-inner ul.meta li a i' => 'color: {{VALUE}}', |
|---|
| 1254 | ], |
|---|
| 1255 | ] |
|---|
| 1256 | ); |
|---|
| 1257 | $this->add_control( |
|---|
| 1258 | 'meta_color_hover', |
|---|
| 1259 | [ |
|---|
| 1260 | 'label' => __( 'Meta Hover Color', 'htmega-addons' ), |
|---|
| 1261 | 'type' => Controls_Manager::COLOR, |
|---|
| 1262 | 'selectors' => [ |
|---|
| 1263 | '{{WRAPPER}} .post-carousel-wrapper .htmega-single-post-slide .content .post-inner ul.meta li a:hover' => 'color: {{VALUE}}', |
|---|
| 1264 | ], |
|---|
| 1265 | ] |
|---|
| 1266 | ); |
|---|
| 1267 | $this->add_control( |
|---|
| 1268 | 'meta_separator_color', |
|---|
| 1269 | [ |
|---|
| 1270 | 'label' => __( 'Separator Color', 'htmega-addons' ), |
|---|
| 1271 | 'type' => Controls_Manager::COLOR, |
|---|
| 1272 | 'selectors' => [ |
|---|
| 1273 | '{{WRAPPER}} .post-carousel-wrapper .htmega-postslider-layout-5 .content .post-inner ul.meta li::before' => 'color: {{VALUE}}', |
|---|
| 1274 | ], |
|---|
| 1275 | 'condition' => [ |
|---|
| 1276 | 'post_carousel_style' => '5', |
|---|
| 1277 | ], |
|---|
| 1278 | ] |
|---|
| 1279 | ); |
|---|
| 1280 | $this->add_group_control( |
|---|
| 1281 | Group_Control_Typography::get_type(), |
|---|
| 1282 | [ |
|---|
| 1283 | 'name' => 'meta_typography', |
|---|
| 1284 | 'label' => __( 'Typography', 'htmega-addons' ), |
|---|
| 1285 | 'selector' => '{{WRAPPER}} .post-carousel-wrapper .htmega-single-post-slide ul.meta li', |
|---|
| 1286 | ] |
|---|
| 1287 | ); |
|---|
| 1288 | |
|---|
| 1289 | $this->add_responsive_control( |
|---|
| 1290 | 'meta_margin', |
|---|
| 1291 | [ |
|---|
| 1292 | 'label' => __( 'Margin', 'htmega-addons' ), |
|---|
| 1293 | 'type' => Controls_Manager::DIMENSIONS, |
|---|
| 1294 | 'size_units' => [ 'px', '%', 'em' ], |
|---|
| 1295 | 'selectors' => [ |
|---|
| 1296 | '{{WRAPPER}} .post-carousel-wrapper .htmega-single-post-slide ul.meta li' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
|---|
| 1297 | ], |
|---|
| 1298 | ] |
|---|
| 1299 | ); |
|---|
| 1300 | |
|---|
| 1301 | $this->add_responsive_control( |
|---|
| 1302 | 'meta_padding', |
|---|
| 1303 | [ |
|---|
| 1304 | 'label' => __( 'Padding', 'htmega-addons' ), |
|---|
| 1305 | 'type' => Controls_Manager::DIMENSIONS, |
|---|
| 1306 | 'size_units' => [ 'px', '%', 'em' ], |
|---|
| 1307 | 'selectors' => [ |
|---|
| 1308 | '{{WRAPPER}} .post-carousel-wrapper .htmega-single-post-slide ul.meta li' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
|---|
| 1309 | ], |
|---|
| 1310 | ] |
|---|
| 1311 | ); |
|---|
| 1312 | |
|---|
| 1313 | $this->add_responsive_control( |
|---|
| 1314 | 'meta_align', |
|---|
| 1315 | [ |
|---|
| 1316 | 'label' => __( 'Alignment', 'htmega-addons' ), |
|---|
| 1317 | 'type' => Controls_Manager::CHOOSE, |
|---|
| 1318 | 'options' => [ |
|---|
| 1319 | 'start' => [ |
|---|
| 1320 | 'title' => __( 'Left', 'htmega-addons' ), |
|---|
| 1321 | 'icon' => 'eicon-text-align-left', |
|---|
| 1322 | ], |
|---|
| 1323 | 'center' => [ |
|---|
| 1324 | 'title' => __( 'Center', 'htmega-addons' ), |
|---|
| 1325 | 'icon' => 'eicon-text-align-center', |
|---|
| 1326 | ], |
|---|
| 1327 | 'end' => [ |
|---|
| 1328 | 'title' => __( 'Right', 'htmega-addons' ), |
|---|
| 1329 | 'icon' => 'eicon-text-align-right', |
|---|
| 1330 | ], |
|---|
| 1331 | ], |
|---|
| 1332 | 'selectors' => [ |
|---|
| 1333 | '{{WRAPPER}} .htmega-single-post-slide ul.meta' => 'text-align: {{VALUE}};', |
|---|
| 1334 | ], |
|---|
| 1335 | ] |
|---|
| 1336 | ); |
|---|
| 1337 | |
|---|
| 1338 | $this->end_controls_section(); |
|---|
| 1339 | |
|---|
| 1340 | // Style Read More button tab section |
|---|
| 1341 | $this->start_controls_section( |
|---|
| 1342 | 'post_slider_readmore_style_section', |
|---|
| 1343 | [ |
|---|
| 1344 | 'label' => __( 'Read More', 'htmega-addons' ), |
|---|
| 1345 | 'tab' => Controls_Manager::TAB_STYLE, |
|---|
| 1346 | 'condition'=>[ |
|---|
| 1347 | 'show_read_more_btn'=>'yes', |
|---|
| 1348 | 'read_more_txt!'=>'', |
|---|
| 1349 | ] |
|---|
| 1350 | ] |
|---|
| 1351 | ); |
|---|
| 1352 | $this->start_controls_tabs('readmore_style_tabs'); |
|---|
| 1353 | |
|---|
| 1354 | $this->start_controls_tab( |
|---|
| 1355 | 'readmore_style_normal_tab', |
|---|
| 1356 | [ |
|---|
| 1357 | 'label' => __( 'Normal', 'htmega-addons' ), |
|---|
| 1358 | ] |
|---|
| 1359 | ); |
|---|
| 1360 | |
|---|
| 1361 | $this->add_control( |
|---|
| 1362 | 'readmore_color', |
|---|
| 1363 | [ |
|---|
| 1364 | 'label' => __( 'Color', 'htmega-addons' ), |
|---|
| 1365 | 'type' => Controls_Manager::COLOR, |
|---|
| 1366 | 'default'=>'#464545', |
|---|
| 1367 | 'selectors' => [ |
|---|
| 1368 | '{{WRAPPER}} .post-carousel-wrapper .htmega-single-post-slide .post-btn a.readmore-btn' => 'color: {{VALUE}}; border-bottom: 1px solid {{VALUE}}', |
|---|
| 1369 | ], |
|---|
| 1370 | ] |
|---|
| 1371 | ); |
|---|
| 1372 | |
|---|
| 1373 | $this->add_group_control( |
|---|
| 1374 | Group_Control_Typography::get_type(), |
|---|
| 1375 | [ |
|---|
| 1376 | 'name' => 'readmore_typography', |
|---|
| 1377 | 'label' => __( 'Typography', 'htmega-addons' ), |
|---|
| 1378 | 'selector' => '{{WRAPPER}} .post-carousel-wrapper .htmega-single-post-slide .post-btn a.readmore-btn', |
|---|
| 1379 | ] |
|---|
| 1380 | ); |
|---|
| 1381 | |
|---|
| 1382 | $this->add_responsive_control( |
|---|
| 1383 | 'readmore_margin', |
|---|
| 1384 | [ |
|---|
| 1385 | 'label' => __( 'Margin', 'htmega-addons' ), |
|---|
| 1386 | 'type' => Controls_Manager::DIMENSIONS, |
|---|
| 1387 | 'size_units' => [ 'px', '%', 'em' ], |
|---|
| 1388 | 'selectors' => [ |
|---|
| 1389 | '{{WRAPPER}} .post-carousel-wrapper .htmega-single-post-slide .post-btn a.readmore-btn' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
|---|
| 1390 | ], |
|---|
| 1391 | ] |
|---|
| 1392 | ); |
|---|
| 1393 | |
|---|
| 1394 | $this->add_responsive_control( |
|---|
| 1395 | 'readmore_padding', |
|---|
| 1396 | [ |
|---|
| 1397 | 'label' => __( 'Padding', 'htmega-addons' ), |
|---|
| 1398 | 'type' => Controls_Manager::DIMENSIONS, |
|---|
| 1399 | 'size_units' => [ 'px', '%', 'em' ], |
|---|
| 1400 | 'selectors' => [ |
|---|
| 1401 | '{{WRAPPER}} .post-carousel-wrapper .htmega-single-post-slide .post-btn a.readmore-btn' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
|---|
| 1402 | ], |
|---|
| 1403 | ] |
|---|
| 1404 | ); |
|---|
| 1405 | |
|---|
| 1406 | $this->add_group_control( |
|---|
| 1407 | Group_Control_Background::get_type(), |
|---|
| 1408 | [ |
|---|
| 1409 | 'name' => 'readmore_background', |
|---|
| 1410 | 'label' => __( 'Background', 'htmega-addons' ), |
|---|
| 1411 | 'types' => [ 'classic', 'gradient' ], |
|---|
| 1412 | 'selector' => '{{WRAPPER}} .post-carousel-wrapper .htmega-single-post-slide .post-btn a.readmore-btn', |
|---|
| 1413 | ] |
|---|
| 1414 | ); |
|---|
| 1415 | |
|---|
| 1416 | $this->add_group_control( |
|---|
| 1417 | Group_Control_Border::get_type(), |
|---|
| 1418 | [ |
|---|
| 1419 | 'name' => 'readmore_border', |
|---|
| 1420 | 'label' => __( 'Border', 'htmega-addons' ), |
|---|
| 1421 | 'selector' => '{{WRAPPER}} .post-carousel-wrapper .htmega-single-post-slide .post-btn a.readmore-btn', |
|---|
| 1422 | ] |
|---|
| 1423 | ); |
|---|
| 1424 | |
|---|
| 1425 | $this->add_responsive_control( |
|---|
| 1426 | 'readmore_border_radius', |
|---|
| 1427 | [ |
|---|
| 1428 | 'label' => esc_html__( 'Border Radius', 'htmega-addons' ), |
|---|
| 1429 | 'type' => Controls_Manager::DIMENSIONS, |
|---|
| 1430 | 'selectors' => [ |
|---|
| 1431 | '{{WRAPPER}} .post-carousel-wrapper .htmega-single-post-slide .post-btn a.readmore-btn' => 'border-radius: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;', |
|---|
| 1432 | ], |
|---|
| 1433 | ] |
|---|
| 1434 | ); |
|---|
| 1435 | $this->add_responsive_control( |
|---|
| 1436 | 'read_more_alignment', |
|---|
| 1437 | [ |
|---|
| 1438 | 'label' => __( 'Alignment', 'htmega-addons' ), |
|---|
| 1439 | 'type' => Controls_Manager::CHOOSE, |
|---|
| 1440 | 'options' => [ |
|---|
| 1441 | 'start' => [ |
|---|
| 1442 | 'title' => __( 'Left', 'htmega-addons' ), |
|---|
| 1443 | 'icon' => 'eicon-text-align-left', |
|---|
| 1444 | ], |
|---|
| 1445 | 'center' => [ |
|---|
| 1446 | 'title' => __( 'Center', 'htmega-addons' ), |
|---|
| 1447 | 'icon' => 'eicon-text-align-center', |
|---|
| 1448 | ], |
|---|
| 1449 | 'end' => [ |
|---|
| 1450 | 'title' => __( 'Right', 'htmega-addons' ), |
|---|
| 1451 | 'icon' => 'eicon-text-align-right', |
|---|
| 1452 | ], |
|---|
| 1453 | ], |
|---|
| 1454 | 'selectors' => [ |
|---|
| 1455 | '{{WRAPPER}} .post-carousel-wrapper .htmega-single-post-slide .post-btn' => 'text-align: {{VALUE}};', |
|---|
| 1456 | ], |
|---|
| 1457 | ] |
|---|
| 1458 | ); |
|---|
| 1459 | $this->end_controls_tab(); // Normal Tab end |
|---|
| 1460 | |
|---|
| 1461 | $this->start_controls_tab( |
|---|
| 1462 | 'readmore_style_hover_tab', |
|---|
| 1463 | [ |
|---|
| 1464 | 'label' => __( 'Hover', 'htmega-addons' ), |
|---|
| 1465 | ] |
|---|
| 1466 | ); |
|---|
| 1467 | $this->add_control( |
|---|
| 1468 | 'readmore_hover_color', |
|---|
| 1469 | [ |
|---|
| 1470 | 'label' => __( 'Color', 'htmega-addons' ), |
|---|
| 1471 | 'type' => Controls_Manager::COLOR, |
|---|
| 1472 | 'default'=>'#ffffff', |
|---|
| 1473 | 'selectors' => [ |
|---|
| 1474 | '{{WRAPPER}} .post-carousel-wrapper .htmega-single-post-slide .post-btn a.readmore-btn:hover' => 'color: {{VALUE}}', |
|---|
| 1475 | ], |
|---|
| 1476 | ] |
|---|
| 1477 | ); |
|---|
| 1478 | |
|---|
| 1479 | $this->add_group_control( |
|---|
| 1480 | Group_Control_Background::get_type(), |
|---|
| 1481 | [ |
|---|
| 1482 | 'name' => 'readmore_hover_background', |
|---|
| 1483 | 'label' => __( 'Background', 'htmega-addons' ), |
|---|
| 1484 | 'types' => [ 'classic', 'gradient' ], |
|---|
| 1485 | 'selector' => '{{WRAPPER}} .post-carousel-wrapper .htmega-single-post-slide .post-btn a.readmore-btn:hover', |
|---|
| 1486 | ] |
|---|
| 1487 | ); |
|---|
| 1488 | |
|---|
| 1489 | $this->add_group_control( |
|---|
| 1490 | Group_Control_Border::get_type(), |
|---|
| 1491 | [ |
|---|
| 1492 | 'name' => 'readmore_hover_border', |
|---|
| 1493 | 'label' => __( 'Border', 'htmega-addons' ), |
|---|
| 1494 | 'selector' => '{{WRAPPER}} .post-carousel-wrapper .htmega-single-post-slide .post-btn a.readmore-btn:hover', |
|---|
| 1495 | ] |
|---|
| 1496 | ); |
|---|
| 1497 | |
|---|
| 1498 | $this->add_responsive_control( |
|---|
| 1499 | 'readmore_hover_border_radius', |
|---|
| 1500 | [ |
|---|
| 1501 | 'label' => esc_html__( 'Border Radius', 'htmega-addons' ), |
|---|
| 1502 | 'type' => Controls_Manager::DIMENSIONS, |
|---|
| 1503 | 'selectors' => [ |
|---|
| 1504 | '{{WRAPPER}} .post-carousel-wrapper .htmega-single-post-slide .post-btn a.readmore-btn:hover' => 'border-radius: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;', |
|---|
| 1505 | ], |
|---|
| 1506 | ] |
|---|
| 1507 | ); |
|---|
| 1508 | |
|---|
| 1509 | $this->end_controls_tab(); // Hover Tab end |
|---|
| 1510 | |
|---|
| 1511 | $this->end_controls_tabs(); |
|---|
| 1512 | |
|---|
| 1513 | $this->end_controls_section(); |
|---|
| 1514 | |
|---|
| 1515 | // Style Slider arrow style start |
|---|
| 1516 | $this->start_controls_section( |
|---|
| 1517 | 'slider_arrow_style', |
|---|
| 1518 | [ |
|---|
| 1519 | 'label' => __( 'Arrow', 'htmega-addons' ), |
|---|
| 1520 | 'tab' => Controls_Manager::TAB_STYLE, |
|---|
| 1521 | 'condition' =>[ |
|---|
| 1522 | 'slider_on' => 'yes', |
|---|
| 1523 | 'slarrows' => 'yes', |
|---|
| 1524 | ], |
|---|
| 1525 | ] |
|---|
| 1526 | ); |
|---|
| 1527 | |
|---|
| 1528 | $this->start_controls_tabs( 'slider_arrow_style_tabs' ); |
|---|
| 1529 | |
|---|
| 1530 | // Normal tab Start |
|---|
| 1531 | $this->start_controls_tab( |
|---|
| 1532 | 'slider_arrow_style_normal_tab', |
|---|
| 1533 | [ |
|---|
| 1534 | 'label' => __( 'Normal', 'htmega-addons' ), |
|---|
| 1535 | ] |
|---|
| 1536 | ); |
|---|
| 1537 | |
|---|
| 1538 | $this->add_control( |
|---|
| 1539 | 'slider_arrow_color', |
|---|
| 1540 | [ |
|---|
| 1541 | 'label' => __( 'Color', 'htmega-addons' ), |
|---|
| 1542 | 'type' => Controls_Manager::COLOR, |
|---|
| 1543 | 'default' => '#00282a', |
|---|
| 1544 | 'selectors' => [ |
|---|
| 1545 | '{{WRAPPER}} .htmega-carousel-activation button.slick-arrow' => 'color: {{VALUE}};', |
|---|
| 1546 | '{{WRAPPER}} .htmega-carousel-activation button.slick-arrow svg path' => 'fill: {{VALUE}};', |
|---|
| 1547 | ], |
|---|
| 1548 | ] |
|---|
| 1549 | ); |
|---|
| 1550 | |
|---|
| 1551 | $this->add_responsive_control( |
|---|
| 1552 | 'slider_arrow_fontsize', |
|---|
| 1553 | [ |
|---|
| 1554 | 'label' => __( 'Font Size', 'htmega-addons' ), |
|---|
| 1555 | 'type' => Controls_Manager::SLIDER, |
|---|
| 1556 | 'size_units' => [ 'px', '%' ], |
|---|
| 1557 | 'range' => [ |
|---|
| 1558 | 'px' => [ |
|---|
| 1559 | 'min' => 0, |
|---|
| 1560 | 'max' => 100, |
|---|
| 1561 | 'step' => 1, |
|---|
| 1562 | ], |
|---|
| 1563 | '%' => [ |
|---|
| 1564 | 'min' => 0, |
|---|
| 1565 | 'max' => 100, |
|---|
| 1566 | ], |
|---|
| 1567 | ], |
|---|
| 1568 | 'default' => [ |
|---|
| 1569 | 'unit' => 'px', |
|---|
| 1570 | 'size' => 20, |
|---|
| 1571 | ], |
|---|
| 1572 | 'selectors' => [ |
|---|
| 1573 | '{{WRAPPER}} .htmega-carousel-activation button.slick-arrow' => 'font-size: {{SIZE}}{{UNIT}};', |
|---|
| 1574 | '{{WRAPPER}} .htmega-carousel-activation button.slick-arrow svg' => 'width: {{SIZE}}{{UNIT}};', |
|---|
| 1575 | ], |
|---|
| 1576 | ] |
|---|
| 1577 | ); |
|---|
| 1578 | |
|---|
| 1579 | $this->add_group_control( |
|---|
| 1580 | Group_Control_Background::get_type(), |
|---|
| 1581 | [ |
|---|
| 1582 | 'name' => 'slider_arrow_background', |
|---|
| 1583 | 'label' => __( 'Background', 'htmega-addons' ), |
|---|
| 1584 | 'types' => [ 'classic', 'gradient' ], |
|---|
| 1585 | 'selector' => '{{WRAPPER}} .htmega-carousel-activation button.slick-arrow', |
|---|
| 1586 | ] |
|---|
| 1587 | ); |
|---|
| 1588 | |
|---|
| 1589 | $this->add_group_control( |
|---|
| 1590 | Group_Control_Border::get_type(), |
|---|
| 1591 | [ |
|---|
| 1592 | 'name' => 'slider_arrow_border', |
|---|
| 1593 | 'label' => __( 'Border', 'htmega-addons' ), |
|---|
| 1594 | 'selector' => '{{WRAPPER}} .htmega-carousel-activation button.slick-arrow', |
|---|
| 1595 | ] |
|---|
| 1596 | ); |
|---|
| 1597 | |
|---|
| 1598 | $this->add_responsive_control( |
|---|
| 1599 | 'slider_border_radius', |
|---|
| 1600 | [ |
|---|
| 1601 | 'label' => esc_html__( 'Border Radius', 'htmega-addons' ), |
|---|
| 1602 | 'type' => Controls_Manager::DIMENSIONS, |
|---|
| 1603 | 'selectors' => [ |
|---|
| 1604 | '{{WRAPPER}} .htmega-carousel-activation button.slick-arrow' => 'border-radius: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;', |
|---|
| 1605 | ], |
|---|
| 1606 | ] |
|---|
| 1607 | ); |
|---|
| 1608 | |
|---|
| 1609 | $this->add_responsive_control( |
|---|
| 1610 | 'slider_arrow_height', |
|---|
| 1611 | [ |
|---|
| 1612 | 'label' => __( 'Height', 'htmega-addons' ), |
|---|
| 1613 | 'type' => Controls_Manager::SLIDER, |
|---|
| 1614 | 'size_units' => [ 'px', '%' ], |
|---|
| 1615 | 'range' => [ |
|---|
| 1616 | 'px' => [ |
|---|
| 1617 | 'min' => 0, |
|---|
| 1618 | 'max' => 1000, |
|---|
| 1619 | 'step' => 1, |
|---|
| 1620 | ], |
|---|
| 1621 | '%' => [ |
|---|
| 1622 | 'min' => 0, |
|---|
| 1623 | 'max' => 100, |
|---|
| 1624 | ], |
|---|
| 1625 | ], |
|---|
| 1626 | 'default' => [ |
|---|
| 1627 | 'unit' => 'px', |
|---|
| 1628 | 'size' => 40, |
|---|
| 1629 | ], |
|---|
| 1630 | 'selectors' => [ |
|---|
| 1631 | '{{WRAPPER}} .htmega-carousel-activation button.slick-arrow' => 'height: {{SIZE}}{{UNIT}};', |
|---|
| 1632 | ], |
|---|
| 1633 | ] |
|---|
| 1634 | ); |
|---|
| 1635 | |
|---|
| 1636 | $this->add_responsive_control( |
|---|
| 1637 | 'slider_arrow_width', |
|---|
| 1638 | [ |
|---|
| 1639 | 'label' => __( 'Width', 'htmega-addons' ), |
|---|
| 1640 | 'type' => Controls_Manager::SLIDER, |
|---|
| 1641 | 'size_units' => [ 'px', '%' ], |
|---|
| 1642 | 'range' => [ |
|---|
| 1643 | 'px' => [ |
|---|
| 1644 | 'min' => 0, |
|---|
| 1645 | 'max' => 1000, |
|---|
| 1646 | 'step' => 1, |
|---|
| 1647 | ], |
|---|
| 1648 | '%' => [ |
|---|
| 1649 | 'min' => 0, |
|---|
| 1650 | 'max' => 100, |
|---|
| 1651 | ], |
|---|
| 1652 | ], |
|---|
| 1653 | 'default' => [ |
|---|
| 1654 | 'unit' => 'px', |
|---|
| 1655 | 'size' => 46, |
|---|
| 1656 | ], |
|---|
| 1657 | 'selectors' => [ |
|---|
| 1658 | '{{WRAPPER}} .htmega-carousel-activation button.slick-arrow' => 'width: {{SIZE}}{{UNIT}};', |
|---|
| 1659 | ], |
|---|
| 1660 | ] |
|---|
| 1661 | ); |
|---|
| 1662 | |
|---|
| 1663 | $this->add_responsive_control( |
|---|
| 1664 | 'slider_arrow_padding', |
|---|
| 1665 | [ |
|---|
| 1666 | 'label' => __( 'Padding', 'htmega-addons' ), |
|---|
| 1667 | 'type' => Controls_Manager::DIMENSIONS, |
|---|
| 1668 | 'size_units' => [ 'px', '%', 'em' ], |
|---|
| 1669 | 'selectors' => [ |
|---|
| 1670 | '{{WRAPPER}} .htmega-carousel-activation button.slick-arrow' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
|---|
| 1671 | ], |
|---|
| 1672 | 'separator' =>'before', |
|---|
| 1673 | ] |
|---|
| 1674 | ); |
|---|
| 1675 | $this->add_control( |
|---|
| 1676 | 'slider_arrow_postion_option', |
|---|
| 1677 | [ |
|---|
| 1678 | 'label' => __( 'Arrow Position', 'htmega-addons' ), |
|---|
| 1679 | 'type' => Controls_Manager::SELECT, |
|---|
| 1680 | 'options' => [ |
|---|
| 1681 | 'htmega-top-right-arrow' => __( 'Top Right', 'htmega-addons' ), |
|---|
| 1682 | 'htmega-bottom-right-arrow' => __( 'Bottom Right', 'htmega-addons' ), |
|---|
| 1683 | 'htmega-verticle-center-arrow' => __( 'Vertical Center', 'htmega-addons' ), |
|---|
| 1684 | 'htmega-bottom-center-arrow' => __( 'Bottom Center', 'htmega-addons' ), |
|---|
| 1685 | ], |
|---|
| 1686 | 'default' =>'htmega-verticle-center-arrow' |
|---|
| 1687 | |
|---|
| 1688 | ] |
|---|
| 1689 | ); |
|---|
| 1690 | $this->add_responsive_control( |
|---|
| 1691 | 'slider_arrow_horizontal_postion', |
|---|
| 1692 | [ |
|---|
| 1693 | 'label' => __( 'Horizontal Position', 'htmega-addons' ), |
|---|
| 1694 | 'type' => Controls_Manager::SLIDER, |
|---|
| 1695 | 'size_units' => [ 'px', '%' ], |
|---|
| 1696 | 'range' => [ |
|---|
| 1697 | 'px' => [ |
|---|
| 1698 | 'min' => -1000, |
|---|
| 1699 | 'max' => 1000, |
|---|
| 1700 | 'step' => 1, |
|---|
| 1701 | ], |
|---|
| 1702 | '%' => [ |
|---|
| 1703 | 'min' => -100, |
|---|
| 1704 | 'max' => 100, |
|---|
| 1705 | ], |
|---|
| 1706 | ], |
|---|
| 1707 | 'default' => [ |
|---|
| 1708 | 'unit' => 'px', |
|---|
| 1709 | ], |
|---|
| 1710 | 'selectors' => [ |
|---|
| 1711 | '{{WRAPPER}} .post-carousel-wrapper button.slick-arrow' => 'left: {{SIZE}}{{UNIT}};', |
|---|
| 1712 | '{{WRAPPER}} .post-carousel-wrapper button.htmega-carosul-next.slick-arrow' => 'right: {{SIZE}}{{UNIT}}; left:auto;', |
|---|
| 1713 | ], |
|---|
| 1714 | 'condition'=>[ |
|---|
| 1715 | 'slider_arrow_postion_option' => 'htmega-verticle-center-arrow', |
|---|
| 1716 | ] |
|---|
| 1717 | ] |
|---|
| 1718 | ); |
|---|
| 1719 | $this->add_responsive_control( |
|---|
| 1720 | 'slider_arrow_horizontal_postion_prev', |
|---|
| 1721 | [ |
|---|
| 1722 | 'label' => __( 'Horizontal Position Prev', 'htmega-addons' ), |
|---|
| 1723 | 'type' => Controls_Manager::SLIDER, |
|---|
| 1724 | 'size_units' => [ 'px', '%' ], |
|---|
| 1725 | 'range' => [ |
|---|
| 1726 | 'px' => [ |
|---|
| 1727 | 'min' => -1000, |
|---|
| 1728 | 'max' => 1000, |
|---|
| 1729 | 'step' => 1, |
|---|
| 1730 | ], |
|---|
| 1731 | '%' => [ |
|---|
| 1732 | 'min' => -100, |
|---|
| 1733 | 'max' => 100, |
|---|
| 1734 | ], |
|---|
| 1735 | ], |
|---|
| 1736 | 'default' => [ |
|---|
| 1737 | 'unit' => 'px', |
|---|
| 1738 | ], |
|---|
| 1739 | 'selectors' => [ |
|---|
| 1740 | '{{WRAPPER}} .post-carousel-wrapper.htmega-top-right-arrow button.slick-arrow,{{WRAPPER}} .post-carousel-wrapper.htmega-bottom-right-arrow button.slick-arrow' => 'right: {{SIZE}}{{UNIT}}; left:auto;', |
|---|
| 1741 | '{{WRAPPER}} .post-carousel-wrapper.htmega-bottom-center-arrow button.slick-arrow' => 'margin-left: {{SIZE}}{{UNIT}};', |
|---|
| 1742 | |
|---|
| 1743 | ], |
|---|
| 1744 | 'condition'=>[ |
|---|
| 1745 | 'slider_arrow_postion_option!' => 'htmega-verticle-center-arrow', |
|---|
| 1746 | ] |
|---|
| 1747 | ] |
|---|
| 1748 | ); |
|---|
| 1749 | $this->add_responsive_control( |
|---|
| 1750 | 'slider_arrow_horizontal_postion_right', |
|---|
| 1751 | [ |
|---|
| 1752 | 'label' => __( 'Horizontal Position Next', 'htmega-addons' ), |
|---|
| 1753 | 'type' => Controls_Manager::SLIDER, |
|---|
| 1754 | 'size_units' => [ 'px', '%' ], |
|---|
| 1755 | 'range' => [ |
|---|
| 1756 | 'px' => [ |
|---|
| 1757 | 'min' => -1000, |
|---|
| 1758 | 'max' => 1000, |
|---|
| 1759 | 'step' => 1, |
|---|
| 1760 | ], |
|---|
| 1761 | '%' => [ |
|---|
| 1762 | 'min' => -100, |
|---|
| 1763 | 'max' => 100, |
|---|
| 1764 | ], |
|---|
| 1765 | ], |
|---|
| 1766 | 'default' => [ |
|---|
| 1767 | 'unit' => 'px', |
|---|
| 1768 | ], |
|---|
| 1769 | 'selectors' => [ |
|---|
| 1770 | '{{WRAPPER}} .post-carousel-wrapper.htmega-top-right-arrow button.htmega-carosul-next.slick-arrow,{{WRAPPER}} .post-carousel-wrapper.htmega-bottom-right-arrow button.htmega-carosul-next.slick-arrow' => 'right: {{SIZE}}{{UNIT}}; left:auto;', |
|---|
| 1771 | '{{WRAPPER}} .post-carousel-wrapper.htmega-bottom-center-arrow button.htmega-carosul-next.slick-arrow' => 'margin-right: {{SIZE}}{{UNIT}}; left:auto;', |
|---|
| 1772 | ], |
|---|
| 1773 | 'condition'=>[ |
|---|
| 1774 | 'slider_arrow_postion_option!' => 'htmega-verticle-center-arrow', |
|---|
| 1775 | ] |
|---|
| 1776 | ] |
|---|
| 1777 | ); |
|---|
| 1778 | |
|---|
| 1779 | |
|---|
| 1780 | $this->add_responsive_control( |
|---|
| 1781 | 'slider_arrow_verticle_postion', |
|---|
| 1782 | [ |
|---|
| 1783 | 'label' => __( 'Vertical Position', 'htmega-addons' ), |
|---|
| 1784 | 'type' => Controls_Manager::SLIDER, |
|---|
| 1785 | 'size_units' => [ 'px', '%' ], |
|---|
| 1786 | 'range' => [ |
|---|
| 1787 | 'px' => [ |
|---|
| 1788 | 'min' => -1000, |
|---|
| 1789 | 'max' => 1000, |
|---|
| 1790 | 'step' => 1, |
|---|
| 1791 | ], |
|---|
| 1792 | '%' => [ |
|---|
| 1793 | 'min' => -100, |
|---|
| 1794 | 'max' => 100, |
|---|
| 1795 | ], |
|---|
| 1796 | ], |
|---|
| 1797 | 'default' => [ |
|---|
| 1798 | 'unit' => 'px', |
|---|
| 1799 | ], |
|---|
| 1800 | 'selectors' => [ |
|---|
| 1801 | '{{WRAPPER}} .post-carousel-wrapper button.slick-arrow' => 'margin-top: {{SIZE}}{{UNIT}};', |
|---|
| 1802 | ], |
|---|
| 1803 | ] |
|---|
| 1804 | ); |
|---|
| 1805 | $this->end_controls_tab(); // Normal tab end |
|---|
| 1806 | |
|---|
| 1807 | // Hover tab Start |
|---|
| 1808 | $this->start_controls_tab( |
|---|
| 1809 | 'slider_arrow_style_hover_tab', |
|---|
| 1810 | [ |
|---|
| 1811 | 'label' => __( 'Hover', 'htmega-addons' ), |
|---|
| 1812 | ] |
|---|
| 1813 | ); |
|---|
| 1814 | |
|---|
| 1815 | $this->add_control( |
|---|
| 1816 | 'slider_arrow_hover_color', |
|---|
| 1817 | [ |
|---|
| 1818 | 'label' => __( 'Color', 'htmega-addons' ), |
|---|
| 1819 | 'type' => Controls_Manager::COLOR, |
|---|
| 1820 | 'default' => '#00282a', |
|---|
| 1821 | 'selectors' => [ |
|---|
| 1822 | '{{WRAPPER}} .htmega-carousel-activation button.slick-arrow:hover' => 'color: {{VALUE}};', |
|---|
| 1823 | '{{WRAPPER}} .htmega-carousel-activation button.slick-arrow:hover svg path' => 'fill: {{VALUE}};', |
|---|
| 1824 | ], |
|---|
| 1825 | ] |
|---|
| 1826 | ); |
|---|
| 1827 | |
|---|
| 1828 | $this->add_group_control( |
|---|
| 1829 | Group_Control_Background::get_type(), |
|---|
| 1830 | [ |
|---|
| 1831 | 'name' => 'slider_arrow_hover_background', |
|---|
| 1832 | 'label' => __( 'Background', 'htmega-addons' ), |
|---|
| 1833 | 'types' => [ 'classic', 'gradient' ], |
|---|
| 1834 | 'selector' => '{{WRAPPER}} .htmega-carousel-activation button.slick-arrow:hover', |
|---|
| 1835 | ] |
|---|
| 1836 | ); |
|---|
| 1837 | |
|---|
| 1838 | $this->add_group_control( |
|---|
| 1839 | Group_Control_Border::get_type(), |
|---|
| 1840 | [ |
|---|
| 1841 | 'name' => 'slider_arrow_hover_border', |
|---|
| 1842 | 'label' => __( 'Border', 'htmega-addons' ), |
|---|
| 1843 | 'selector' => '{{WRAPPER}} .htmega-carousel-activation button.slick-arrow:hover', |
|---|
| 1844 | ] |
|---|
| 1845 | ); |
|---|
| 1846 | |
|---|
| 1847 | $this->add_responsive_control( |
|---|
| 1848 | 'slider_arrow_hover_border_radius', |
|---|
| 1849 | [ |
|---|
| 1850 | 'label' => esc_html__( 'Border Radius', 'htmega-addons' ), |
|---|
| 1851 | 'type' => Controls_Manager::DIMENSIONS, |
|---|
| 1852 | 'selectors' => [ |
|---|
| 1853 | '{{WRAPPER}} .htmega-carousel-activation button.slick-arrow:hover' => 'border-radius: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;', |
|---|
| 1854 | ], |
|---|
| 1855 | ] |
|---|
| 1856 | ); |
|---|
| 1857 | |
|---|
| 1858 | $this->end_controls_tab(); // Hover tab end |
|---|
| 1859 | |
|---|
| 1860 | $this->end_controls_tabs(); |
|---|
| 1861 | |
|---|
| 1862 | $this->end_controls_section(); // Style Slider arrow style end |
|---|
| 1863 | |
|---|
| 1864 | // Style Pagination button tab section |
|---|
| 1865 | $this->start_controls_section( |
|---|
| 1866 | 'post_slider_pagination_style_section', |
|---|
| 1867 | [ |
|---|
| 1868 | 'label' => __( 'Pagination', 'htmega-addons' ), |
|---|
| 1869 | 'tab' => Controls_Manager::TAB_STYLE, |
|---|
| 1870 | 'condition'=>[ |
|---|
| 1871 | 'slider_on' => 'yes', |
|---|
| 1872 | 'sldots'=>'yes', |
|---|
| 1873 | |
|---|
| 1874 | ] |
|---|
| 1875 | ] |
|---|
| 1876 | ); |
|---|
| 1877 | |
|---|
| 1878 | $this->start_controls_tabs('pagination_style_tabs'); |
|---|
| 1879 | |
|---|
| 1880 | $this->start_controls_tab( |
|---|
| 1881 | 'pagination_style_normal_tab', |
|---|
| 1882 | [ |
|---|
| 1883 | 'label' => __( 'Normal', 'htmega-addons' ), |
|---|
| 1884 | ] |
|---|
| 1885 | ); |
|---|
| 1886 | |
|---|
| 1887 | $this->add_responsive_control( |
|---|
| 1888 | 'slider_pagination_height', |
|---|
| 1889 | [ |
|---|
| 1890 | 'label' => __( 'Height', 'htmega-addons' ), |
|---|
| 1891 | 'type' => Controls_Manager::SLIDER, |
|---|
| 1892 | 'size_units' => [ 'px', '%' ], |
|---|
| 1893 | 'range' => [ |
|---|
| 1894 | 'px' => [ |
|---|
| 1895 | 'min' => 0, |
|---|
| 1896 | 'max' => 1000, |
|---|
| 1897 | 'step' => 1, |
|---|
| 1898 | ], |
|---|
| 1899 | '%' => [ |
|---|
| 1900 | 'min' => 0, |
|---|
| 1901 | 'max' => 100, |
|---|
| 1902 | ], |
|---|
| 1903 | ], |
|---|
| 1904 | 'default' => [ |
|---|
| 1905 | 'unit' => 'px', |
|---|
| 1906 | 'size' => 15, |
|---|
| 1907 | ], |
|---|
| 1908 | 'selectors' => [ |
|---|
| 1909 | '{{WRAPPER}} .htmega-carousel-activation .slick-dots li button' => 'height: {{SIZE}}{{UNIT}};', |
|---|
| 1910 | ], |
|---|
| 1911 | ] |
|---|
| 1912 | ); |
|---|
| 1913 | |
|---|
| 1914 | $this->add_responsive_control( |
|---|
| 1915 | 'slider_pagination_width', |
|---|
| 1916 | [ |
|---|
| 1917 | 'label' => __( 'Width', 'htmega-addons' ), |
|---|
| 1918 | 'type' => Controls_Manager::SLIDER, |
|---|
| 1919 | 'size_units' => [ 'px', '%' ], |
|---|
| 1920 | 'range' => [ |
|---|
| 1921 | 'px' => [ |
|---|
| 1922 | 'min' => 0, |
|---|
| 1923 | 'max' => 1000, |
|---|
| 1924 | 'step' => 1, |
|---|
| 1925 | ], |
|---|
| 1926 | '%' => [ |
|---|
| 1927 | 'min' => 0, |
|---|
| 1928 | 'max' => 100, |
|---|
| 1929 | ], |
|---|
| 1930 | ], |
|---|
| 1931 | 'default' => [ |
|---|
| 1932 | 'unit' => 'px', |
|---|
| 1933 | 'size' => 15, |
|---|
| 1934 | ], |
|---|
| 1935 | 'selectors' => [ |
|---|
| 1936 | '{{WRAPPER}} .htmega-carousel-activation .slick-dots li button' => 'width: {{SIZE}}{{UNIT}};', |
|---|
| 1937 | ], |
|---|
| 1938 | ] |
|---|
| 1939 | ); |
|---|
| 1940 | |
|---|
| 1941 | $this->add_group_control( |
|---|
| 1942 | Group_Control_Background::get_type(), |
|---|
| 1943 | [ |
|---|
| 1944 | 'name' => 'pagination_background', |
|---|
| 1945 | 'label' => __( 'Background', 'htmega-addons' ), |
|---|
| 1946 | 'types' => [ 'classic', 'gradient' ], |
|---|
| 1947 | 'selector' => '{{WRAPPER}} .htmega-carousel-activation .slick-dots li button', |
|---|
| 1948 | ] |
|---|
| 1949 | ); |
|---|
| 1950 | |
|---|
| 1951 | $this->add_responsive_control( |
|---|
| 1952 | 'pagination_margin', |
|---|
| 1953 | [ |
|---|
| 1954 | 'label' => __( 'Margin', 'htmega-addons' ), |
|---|
| 1955 | 'type' => Controls_Manager::DIMENSIONS, |
|---|
| 1956 | 'size_units' => [ 'px', '%', 'em' ], |
|---|
| 1957 | 'selectors' => [ |
|---|
| 1958 | '{{WRAPPER}} .htmega-carousel-activation .slick-dots li' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
|---|
| 1959 | ], |
|---|
| 1960 | ] |
|---|
| 1961 | ); |
|---|
| 1962 | |
|---|
| 1963 | $this->add_group_control( |
|---|
| 1964 | Group_Control_Border::get_type(), |
|---|
| 1965 | [ |
|---|
| 1966 | 'name' => 'pagination_border', |
|---|
| 1967 | 'label' => __( 'Border', 'htmega-addons' ), |
|---|
| 1968 | 'selector' => '{{WRAPPER}} .htmega-carousel-activation .slick-dots li button', |
|---|
| 1969 | ] |
|---|
| 1970 | ); |
|---|
| 1971 | |
|---|
| 1972 | $this->add_responsive_control( |
|---|
| 1973 | 'pagination_border_radius', |
|---|
| 1974 | [ |
|---|
| 1975 | 'label' => esc_html__( 'Border Radius', 'htmega-addons' ), |
|---|
| 1976 | 'type' => Controls_Manager::DIMENSIONS, |
|---|
| 1977 | 'selectors' => [ |
|---|
| 1978 | '{{WRAPPER}} .htmega-carousel-activation .slick-dots li button' => 'border-radius: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;', |
|---|
| 1979 | ], |
|---|
| 1980 | ] |
|---|
| 1981 | ); |
|---|
| 1982 | |
|---|
| 1983 | $this->end_controls_tab(); // Normal Tab end |
|---|
| 1984 | |
|---|
| 1985 | $this->start_controls_tab( |
|---|
| 1986 | 'pagination_style_active_tab', |
|---|
| 1987 | [ |
|---|
| 1988 | 'label' => __( 'Active', 'htmega-addons' ), |
|---|
| 1989 | ] |
|---|
| 1990 | ); |
|---|
| 1991 | |
|---|
| 1992 | $this->add_group_control( |
|---|
| 1993 | Group_Control_Background::get_type(), |
|---|
| 1994 | [ |
|---|
| 1995 | 'name' => 'pagination_hover_background', |
|---|
| 1996 | 'label' => __( 'Background', 'htmega-addons' ), |
|---|
| 1997 | 'types' => [ 'classic', 'gradient' ], |
|---|
| 1998 | 'selector' => '{{WRAPPER}} .htmega-carousel-activation .slick-dots li:hover button, {{WRAPPER}} .htmega-carousel-activation .slick-dots li.slick-active button', |
|---|
| 1999 | ] |
|---|
| 2000 | ); |
|---|
| 2001 | |
|---|
| 2002 | $this->add_group_control( |
|---|
| 2003 | Group_Control_Border::get_type(), |
|---|
| 2004 | [ |
|---|
| 2005 | 'name' => 'pagination_hover_border', |
|---|
| 2006 | 'label' => __( 'Border', 'htmega-addons' ), |
|---|
| 2007 | 'selector' => '{{WRAPPER}} .htmega-carousel-activation .slick-dots li:hover button, {{WRAPPER}} .htmega-carousel-activation .slick-dots li.slick-active button', |
|---|
| 2008 | ] |
|---|
| 2009 | ); |
|---|
| 2010 | |
|---|
| 2011 | $this->add_responsive_control( |
|---|
| 2012 | 'pagination_hover_border_radius', |
|---|
| 2013 | [ |
|---|
| 2014 | 'label' => esc_html__( 'Border Radius', 'htmega-addons' ), |
|---|
| 2015 | 'type' => Controls_Manager::DIMENSIONS, |
|---|
| 2016 | 'selectors' => [ |
|---|
| 2017 | '{{WRAPPER}} .htmega-carousel-activation .slick-dots li.slick-active button' => 'border-radius: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;', |
|---|
| 2018 | '{{WRAPPER}} .htmega-carousel-activation .slick-dots li:hover button' => 'border-radius: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;', |
|---|
| 2019 | ], |
|---|
| 2020 | ] |
|---|
| 2021 | ); |
|---|
| 2022 | |
|---|
| 2023 | $this->end_controls_tab(); // Hover Tab end |
|---|
| 2024 | |
|---|
| 2025 | $this->end_controls_tabs(); |
|---|
| 2026 | |
|---|
| 2027 | $this->end_controls_section(); |
|---|
| 2028 | |
|---|
| 2029 | } |
|---|
| 2030 | |
|---|
| 2031 | protected function render( $instance = [] ) { |
|---|
| 2032 | |
|---|
| 2033 | $settings = $this->get_settings_for_display(); |
|---|
| 2034 | $sectionid = "sid". $this-> get_id(); |
|---|
| 2035 | $post_slider_image_overlay_hover = $settings['post_slider_image_overlay_hover_background']; |
|---|
| 2036 | $htmega_post_image = $this->get_settings_for_display('htmega_post_image_size'); |
|---|
| 2037 | $post_type = $settings['carousel_post_type']; |
|---|
| 2038 | |
|---|
| 2039 | if( 'post'== $post_type ){ |
|---|
| 2040 | $post_categorys = $settings['carousel_categories']; |
|---|
| 2041 | } else if( 'product'== $post_type ){ |
|---|
| 2042 | $post_categorys = $settings['carousel_prod_categories']; |
|---|
| 2043 | }else { |
|---|
| 2044 | $post_categorys = $settings[ $post_type.'_post_category']; |
|---|
| 2045 | } |
|---|
| 2046 | |
|---|
| 2047 | $post_author = $settings['post_author']; |
|---|
| 2048 | $exclude_posts = $settings['exclude_posts']; |
|---|
| 2049 | $orderby = $this->get_settings_for_display('orderby'); |
|---|
| 2050 | $postorder = $this->get_settings_for_display('postorder'); |
|---|
| 2051 | |
|---|
| 2052 | $this->add_render_attribute( 'htmega_post_carousel', 'class', 'post-carousel-wrapper htmega-postcarousel-layout-'.$settings['post_carousel_style'].' '. $settings['slider_arrow_postion_option'].' '.$sectionid); |
|---|
| 2053 | |
|---|
| 2054 | $this->add_render_attribute( 'htmega_post_slider_item_attr', 'class', 'htmega-single-post-slide htmega-postslider-layout-'.$settings['post_carousel_style'] ); |
|---|
| 2055 | // Slider options |
|---|
| 2056 | if( $settings['slider_on'] == 'yes' ){ |
|---|
| 2057 | |
|---|
| 2058 | $direction = is_rtl() ? 'rtl' : 'ltr'; |
|---|
| 2059 | $this->add_render_attribute( 'htmega_post_slider_attr', 'dir', $direction ); |
|---|
| 2060 | |
|---|
| 2061 | $this->add_render_attribute( 'htmega_post_slider_attr', 'class', 'htmega-carousel-activation' ); |
|---|
| 2062 | |
|---|
| 2063 | $slider_settings = [ |
|---|
| 2064 | 'sectionid' => $sectionid, |
|---|
| 2065 | 'arrows' => ('yes' === $settings['slarrows']), |
|---|
| 2066 | 'arrow_prev_txt' => HTMega_Icon_manager::render_icon( $settings['slprevicon'], [ 'aria-hidden' => 'true' ] ), |
|---|
| 2067 | 'arrow_next_txt' => HTMega_Icon_manager::render_icon( $settings['slnexticon'], [ 'aria-hidden' => 'true' ] ), |
|---|
| 2068 | 'dots' => ('yes' === $settings['sldots']), |
|---|
| 2069 | 'autoplay' => ('yes' === $settings['slautolay']), |
|---|
| 2070 | 'autoplay_speed' => absint($settings['slautoplay_speed']), |
|---|
| 2071 | 'animation_speed' => absint($settings['slanimation_speed']), |
|---|
| 2072 | 'slloop' => ('yes' === $settings['slloop']) ? true:false, |
|---|
| 2073 | 'pause_on_hover' => ('yes' === $settings['slpause_on_hover']), |
|---|
| 2074 | 'center_mode' => ( 'yes' === $settings['slcentermode']), |
|---|
| 2075 | 'center_padding' => absint($settings['slcenterpadding']), |
|---|
| 2076 | 'equal_height_column' => ('yes' === $settings['equal_height_column']), |
|---|
| 2077 | 'equal_height_column_class' => '.post-inner', |
|---|
| 2078 | ]; |
|---|
| 2079 | |
|---|
| 2080 | $slider_responsive_settings = [ |
|---|
| 2081 | 'display_columns' => $settings['slitems'], |
|---|
| 2082 | 'scroll_columns' => $settings['slscroll_columns'], |
|---|
| 2083 | 'tablet_width' => $settings['sltablet_width'], |
|---|
| 2084 | 'tablet_display_columns' => $settings['sltablet_display_columns'], |
|---|
| 2085 | 'tablet_scroll_columns' => $settings['sltablet_scroll_columns'], |
|---|
| 2086 | 'mobile_width' => $settings['slmobile_width'], |
|---|
| 2087 | 'mobile_display_columns' => $settings['slmobile_display_columns'], |
|---|
| 2088 | 'mobile_scroll_columns' => $settings['slmobile_scroll_columns'], |
|---|
| 2089 | |
|---|
| 2090 | ]; |
|---|
| 2091 | |
|---|
| 2092 | $slider_settings = array_merge( $slider_settings, $slider_responsive_settings ); |
|---|
| 2093 | |
|---|
| 2094 | $this->add_render_attribute( 'htmega_post_slider_attr', 'data-settings', wp_json_encode( $slider_settings ) ); |
|---|
| 2095 | } |
|---|
| 2096 | |
|---|
| 2097 | // Post query |
|---|
| 2098 | $args = array( |
|---|
| 2099 | 'post_type' => $post_type, |
|---|
| 2100 | 'post_status' => 'publish', |
|---|
| 2101 | 'ignore_sticky_posts' => 1, |
|---|
| 2102 | 'posts_per_page' => !empty( $settings['post_limit'] ) ? (int)$settings['post_limit'] : 3, |
|---|
| 2103 | ); |
|---|
| 2104 | |
|---|
| 2105 | if ( !empty( $post_categorys ) ) { |
|---|
| 2106 | |
|---|
| 2107 | $category_name = get_object_taxonomies($post_type); |
|---|
| 2108 | if( $category_name && $category_name['0'] == "product_type" ){ |
|---|
| 2109 | $category_name['0'] = 'product_cat'; |
|---|
| 2110 | } |
|---|
| 2111 | |
|---|
| 2112 | if( $category_name && is_array($post_categorys) && count($post_categorys) > 0 ){ |
|---|
| 2113 | |
|---|
| 2114 | $field_name = is_numeric( $post_categorys[0] ) ? 'term_id' : 'slug'; |
|---|
| 2115 | $args['tax_query'] = array( |
|---|
| 2116 | array( |
|---|
| 2117 | 'taxonomy' => $category_name[0], |
|---|
| 2118 | 'terms' => $post_categorys, |
|---|
| 2119 | 'field' => $field_name, |
|---|
| 2120 | 'include_children' => false |
|---|
| 2121 | ) |
|---|
| 2122 | ); |
|---|
| 2123 | } |
|---|
| 2124 | } |
|---|
| 2125 | // author check |
|---|
| 2126 | if ( !empty( $post_author ) ) { |
|---|
| 2127 | $args['author__in'] = $post_author; |
|---|
| 2128 | } |
|---|
| 2129 | // order by check |
|---|
| 2130 | if ( !empty( $orderby ) ) { |
|---|
| 2131 | if ( 'date' == $orderby && 'yes'== $settings['custom_order_by_date'] && (!empty( $settings['order_by_date_after'] || $settings['order_by_date_before'] ) ) ) { |
|---|
| 2132 | $order_by_date_after = strtotime($settings['order_by_date_after']); |
|---|
| 2133 | $order_by_date_before = strtotime($settings['order_by_date_before']); |
|---|
| 2134 | $args['date_query'] = array( |
|---|
| 2135 | array( |
|---|
| 2136 | 'before' => array( |
|---|
| 2137 | 'year' => date('Y', $order_by_date_before), |
|---|
| 2138 | 'month' =>date('m', $order_by_date_before), |
|---|
| 2139 | 'day' => date('d', $order_by_date_before), |
|---|
| 2140 | ), |
|---|
| 2141 | 'after' => array( |
|---|
| 2142 | 'year' => date('Y', $order_by_date_after), |
|---|
| 2143 | 'month' =>date('m', $order_by_date_after), |
|---|
| 2144 | 'day' => date('d', $order_by_date_after), |
|---|
| 2145 | ), |
|---|
| 2146 | 'inclusive' => true, |
|---|
| 2147 | ), |
|---|
| 2148 | ); |
|---|
| 2149 | |
|---|
| 2150 | } else { |
|---|
| 2151 | $args['orderby'] = $orderby; |
|---|
| 2152 | } |
|---|
| 2153 | } |
|---|
| 2154 | |
|---|
| 2155 | // Exclude posts check |
|---|
| 2156 | if ( !empty( $exclude_posts ) ) { |
|---|
| 2157 | $exclude_posts = explode(',',$exclude_posts); |
|---|
| 2158 | $args['post__not_in'] = $exclude_posts; |
|---|
| 2159 | } |
|---|
| 2160 | |
|---|
| 2161 | // Order check |
|---|
| 2162 | if ( !empty( $postorder ) ) { |
|---|
| 2163 | $args['order'] = $postorder; |
|---|
| 2164 | } |
|---|
| 2165 | |
|---|
| 2166 | $carousel_post = new \WP_Query( $args ); |
|---|
| 2167 | |
|---|
| 2168 | $s_display_none = ( 'yes' == $settings['slider_on'] ) ? ' style="display:none;"':''; |
|---|
| 2169 | ?> |
|---|
| 2170 | <div <?php echo $this->get_render_attribute_string( 'htmega_post_carousel' ); ?>> |
|---|
| 2171 | <div <?php echo $this->get_render_attribute_string( 'htmega_post_slider_attr' ).$s_display_none; ?>> |
|---|
| 2172 | |
|---|
| 2173 | <?php |
|---|
| 2174 | if( $carousel_post->have_posts() ): |
|---|
| 2175 | while( $carousel_post->have_posts() ): $carousel_post->the_post(); |
|---|
| 2176 | ?> |
|---|
| 2177 | |
|---|
| 2178 | <?php if( $settings['post_carousel_style'] == 2 ): ?> |
|---|
| 2179 | <div <?php echo $this->get_render_attribute_string( 'htmega_post_slider_item_attr' ); ?> > |
|---|
| 2180 | <div class="thumb"> |
|---|
| 2181 | <a href="<?php the_permalink();?>"><?php $this->htmega_render_loop_thumbnail( $htmega_post_image );?></a> |
|---|
| 2182 | </div> |
|---|
| 2183 | <?php $this->htmega_render_loop_content( 2,$carousel_post->ID ); ?> |
|---|
| 2184 | </div> |
|---|
| 2185 | |
|---|
| 2186 | <?php elseif( $settings['post_carousel_style'] == 4 ): ?> |
|---|
| 2187 | <div <?php echo $this->get_render_attribute_string( 'htmega_post_slider_item_attr' ); ?> > |
|---|
| 2188 | <div class="post-carousel-flex"> |
|---|
| 2189 | <div class="thumb"> |
|---|
| 2190 | <a href="<?php the_permalink();?>"><?php $this->htmega_render_loop_thumbnail( $htmega_post_image );?></a> |
|---|
| 2191 | </div> |
|---|
| 2192 | <?php $this->htmega_render_loop_content(null,$carousel_post->ID); ?> |
|---|
| 2193 | </div> |
|---|
| 2194 | </div> |
|---|
| 2195 | |
|---|
| 2196 | <?php elseif( $settings['post_carousel_style'] == 5 ): ?> |
|---|
| 2197 | <div <?php echo $this->get_render_attribute_string( 'htmega_post_slider_item_attr' ); ?> > |
|---|
| 2198 | <div class="thumb"> |
|---|
| 2199 | <a href="<?php the_permalink();?>"><?php $this->htmega_render_loop_thumbnail( $htmega_post_image );?></a> |
|---|
| 2200 | </div> |
|---|
| 2201 | <?php $this->htmega_render_loop_content( 3,$carousel_post->ID ); ?> |
|---|
| 2202 | </div> |
|---|
| 2203 | |
|---|
| 2204 | <?php else:?> |
|---|
| 2205 | <div <?php echo $this->get_render_attribute_string( 'htmega_post_slider_item_attr' ); ?> > |
|---|
| 2206 | <div class="thumb"> |
|---|
| 2207 | <a href="<?php the_permalink();?>"><?php $this->htmega_render_loop_thumbnail( $htmega_post_image ); ?></a> |
|---|
| 2208 | </div> |
|---|
| 2209 | <?php $this->htmega_render_loop_content(null,$carousel_post->ID); ?> |
|---|
| 2210 | </div> |
|---|
| 2211 | <?php endif;?> |
|---|
| 2212 | |
|---|
| 2213 | <?php |
|---|
| 2214 | endwhile; wp_reset_postdata(); wp_reset_query(); |
|---|
| 2215 | |
|---|
| 2216 | else: |
|---|
| 2217 | echo "<div class='htmega-error-notice'>".esc_html__('There are no posts in this query','htmega-addons')."</div>"; |
|---|
| 2218 | endif; ?> |
|---|
| 2219 | |
|---|
| 2220 | </div> |
|---|
| 2221 | </div> |
|---|
| 2222 | |
|---|
| 2223 | <?php |
|---|
| 2224 | if( 'null'!= $post_slider_image_overlay_hover && ''!= $post_slider_image_overlay_hover ){ |
|---|
| 2225 | $htmega_print_css = " |
|---|
| 2226 | .{$sectionid} .htmega-single-post-slide:hover .thumb a:after{ |
|---|
| 2227 | opacity: 0; |
|---|
| 2228 | }"; |
|---|
| 2229 | ?> |
|---|
| 2230 | <style><?php echo esc_html( $htmega_print_css ); ?></style> |
|---|
| 2231 | <?php } ?> |
|---|
| 2232 | |
|---|
| 2233 | |
|---|
| 2234 | <?php |
|---|
| 2235 | |
|---|
| 2236 | } |
|---|
| 2237 | |
|---|
| 2238 | // Loop Content |
|---|
| 2239 | public function htmega_render_loop_content( $contetntstyle = NULL, $post_id = null ){ |
|---|
| 2240 | $settings = $this->get_settings_for_display(); |
|---|
| 2241 | $category_name = get_object_taxonomies($settings['carousel_post_type']); |
|---|
| 2242 | ?> |
|---|
| 2243 | <div class="content <?php echo $settings['border_type']; ?>"> |
|---|
| 2244 | <div class="post-inner"> |
|---|
| 2245 | <?php |
|---|
| 2246 | if( $settings['show_category'] == 'yes' ): |
|---|
| 2247 | if( $category_name ){ |
|---|
| 2248 | $get_terms = get_the_terms($post_id, $category_name[0] ); |
|---|
| 2249 | if($settings['carousel_post_type'] == 'product'){ |
|---|
| 2250 | $get_terms = get_the_terms($post_id, 'product_cat'); |
|---|
| 2251 | } |
|---|
| 2252 | if($get_terms){ |
|---|
| 2253 | ?> |
|---|
| 2254 | <ul class="post-category"> |
|---|
| 2255 | <?php |
|---|
| 2256 | foreach ( $get_terms as $category ) { |
|---|
| 2257 | $term_link = get_term_link( $category ); |
|---|
| 2258 | ?> |
|---|
| 2259 | <li><a href="<?php echo esc_url( $term_link ); ?>" class="category <?php echo esc_attr( $category->slug ); ?>"><?php echo esc_html( $category->name );?></a></li> |
|---|
| 2260 | <?php |
|---|
| 2261 | } |
|---|
| 2262 | ?> |
|---|
| 2263 | </ul> |
|---|
| 2264 | <?php |
|---|
| 2265 | } |
|---|
| 2266 | } |
|---|
| 2267 | endif; ?> |
|---|
| 2268 | |
|---|
| 2269 | <?php |
|---|
| 2270 | if( $contetntstyle == 3 ): |
|---|
| 2271 | if( $settings['show_author'] == 'yes' || $settings['show_date'] == 'yes'): |
|---|
| 2272 | ?> |
|---|
| 2273 | <ul class="meta"> |
|---|
| 2274 | <?php if( $settings['show_author'] == 'yes' ): ?> |
|---|
| 2275 | <li><i class="fa fa-user-circle"></i><a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ), get_the_author_meta( 'user_nicename' ) ); ?>"><?php the_author();?></a></li> |
|---|
| 2276 | <?php endif; if( $settings['show_date'] == 'yes' ):?> |
|---|
| 2277 | <li><i class="fa fa-clock-o"></i><?php the_time('d F Y');?></li> |
|---|
| 2278 | <?php endif; ?> |
|---|
| 2279 | </ul> |
|---|
| 2280 | |
|---|
| 2281 | <?php endif; endif;?> |
|---|
| 2282 | |
|---|
| 2283 | <?php if( $settings['show_title'] == 'yes' ): |
|---|
| 2284 | |
|---|
| 2285 | if ( 0 > $settings['title_length'] ) { ?> |
|---|
| 2286 | <h2><a href="<?php the_permalink();?>"><?php the_title(); ?></a></h2> |
|---|
| 2287 | <?php |
|---|
| 2288 | } else { ?> |
|---|
| 2289 | <h2><a href="<?php the_permalink();?>"><?php echo wp_trim_words( get_the_title(), $settings['title_length'], '' ); ?></a></h2> |
|---|
| 2290 | <?php |
|---|
| 2291 | } |
|---|
| 2292 | |
|---|
| 2293 | endif;?> |
|---|
| 2294 | |
|---|
| 2295 | <?php |
|---|
| 2296 | if( $contetntstyle != 2 ): |
|---|
| 2297 | if( $contetntstyle != 3 ): |
|---|
| 2298 | if( $settings['show_author'] == 'yes' || $settings['show_date'] == 'yes'): |
|---|
| 2299 | ?> |
|---|
| 2300 | <ul class="meta"> |
|---|
| 2301 | <?php if( $settings['show_author'] == 'yes' ): ?> |
|---|
| 2302 | <li><i class="fa fa-user-circle"></i><a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ), get_the_author_meta( 'user_nicename' ) ); ?>"><?php the_author();?></a></li> |
|---|
| 2303 | <?php endif; if( $settings['show_date'] == 'yes' ):?> |
|---|
| 2304 | <li><i class="fa fa-clock-o"></i><?php the_time('d F Y');?></li> |
|---|
| 2305 | <?php endif; ?> |
|---|
| 2306 | </ul> |
|---|
| 2307 | |
|---|
| 2308 | <?php endif; endif;endif;?> |
|---|
| 2309 | |
|---|
| 2310 | <?php |
|---|
| 2311 | if( $settings['show_content'] == 'yes' ){ |
|---|
| 2312 | if( $settings['content_type'] == 'excerpt' ){ |
|---|
| 2313 | echo '<p>'. wp_trim_words( get_the_excerpt(), $settings['content_length'],'' ) .'</p>'; |
|---|
| 2314 | } else { |
|---|
| 2315 | echo '<p>'.wp_trim_words( strip_shortcodes( get_the_content() ), $settings['content_length'], '' ).'</p>'; |
|---|
| 2316 | } |
|---|
| 2317 | } |
|---|
| 2318 | ?> |
|---|
| 2319 | |
|---|
| 2320 | <?php |
|---|
| 2321 | if( $contetntstyle == 2 ): |
|---|
| 2322 | if( $settings['show_author'] == 'yes' || $settings['show_date'] == 'yes'): |
|---|
| 2323 | ?> |
|---|
| 2324 | <ul class="meta"> |
|---|
| 2325 | <?php if( $settings['show_author'] == 'yes' ): ?> |
|---|
| 2326 | <li><i class="fa fa-user-circle"></i><a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ), get_the_author_meta( 'user_nicename' ) ); ?>"><?php the_author();?></a></li> |
|---|
| 2327 | <?php endif; if( $settings['show_date'] == 'yes' ):?> |
|---|
| 2328 | <li><i class="fa fa-clock-o"></i><?php the_time('d F Y');?></li> |
|---|
| 2329 | <?php endif; ?> |
|---|
| 2330 | </ul> |
|---|
| 2331 | |
|---|
| 2332 | <?php endif; endif;?> |
|---|
| 2333 | |
|---|
| 2334 | <?php if( $settings['show_read_more_btn'] == 'yes' ): ?> |
|---|
| 2335 | <div class="post-btn"> |
|---|
| 2336 | <a class="readmore-btn" href="<?php the_permalink();?>"><?php echo htmega_kses_desc( $settings['read_more_txt'] );?></a> |
|---|
| 2337 | </div> |
|---|
| 2338 | <?php endif; ?> |
|---|
| 2339 | |
|---|
| 2340 | </div> |
|---|
| 2341 | </div> |
|---|
| 2342 | <?php |
|---|
| 2343 | } |
|---|
| 2344 | |
|---|
| 2345 | // Loop Thumbnails |
|---|
| 2346 | public function htmega_render_loop_thumbnail( $thumbnails_size = 'full' ){ |
|---|
| 2347 | if ( has_post_thumbnail() ){ |
|---|
| 2348 | the_post_thumbnail( $thumbnails_size ); |
|---|
| 2349 | }else{ |
|---|
| 2350 | echo '<img src="'.HTMEGA_ADDONS_PL_URL.'/assets/images/image-placeholder.png" alt="'.get_the_title().'" />'; |
|---|
| 2351 | } |
|---|
| 2352 | } |
|---|
| 2353 | // post query fields |
|---|
| 2354 | public function show_post_source(){ |
|---|
| 2355 | |
|---|
| 2356 | $this->add_control( |
|---|
| 2357 | 'carousel_post_type', |
|---|
| 2358 | [ |
|---|
| 2359 | 'label' => esc_html__( 'Post Type', 'htmega-addons' ), |
|---|
| 2360 | 'type' => Controls_Manager::SELECT, |
|---|
| 2361 | 'label_block' => true, |
|---|
| 2362 | 'options' => htmega_get_post_types(), |
|---|
| 2363 | 'default' =>'post', |
|---|
| 2364 | 'frontend_available' => true, |
|---|
| 2365 | 'separator' => 'before' |
|---|
| 2366 | ] |
|---|
| 2367 | ); |
|---|
| 2368 | $this->add_control( |
|---|
| 2369 | 'include_by', |
|---|
| 2370 | [ |
|---|
| 2371 | 'label' => __( 'Include By', 'htmega-addons' ), |
|---|
| 2372 | 'type' => Controls_Manager::SELECT2, |
|---|
| 2373 | 'label_block' => true, |
|---|
| 2374 | 'multiple' => true, |
|---|
| 2375 | 'default' =>'in_category', |
|---|
| 2376 | 'options' => [ |
|---|
| 2377 | 'in_author' => __( 'Author', 'htmega-addons' ), |
|---|
| 2378 | 'in_category' => __( 'Category', 'htmega-addons' ), |
|---|
| 2379 | ], |
|---|
| 2380 | ] |
|---|
| 2381 | ); |
|---|
| 2382 | $this->add_control( |
|---|
| 2383 | 'post_author', |
|---|
| 2384 | [ |
|---|
| 2385 | 'label' => esc_html__( 'Authors', 'htmega-addons' ), |
|---|
| 2386 | 'type' => Controls_Manager::SELECT2, |
|---|
| 2387 | 'label_block' => true, |
|---|
| 2388 | 'multiple' => true, |
|---|
| 2389 | 'options' => htmega_get_authors_list(), |
|---|
| 2390 | 'condition' =>[ |
|---|
| 2391 | 'include_by' => 'in_author', |
|---|
| 2392 | ] |
|---|
| 2393 | ] |
|---|
| 2394 | ); |
|---|
| 2395 | $all_post_type = htmega_get_post_types(); |
|---|
| 2396 | foreach( $all_post_type as $post_key => $post_item ){ |
|---|
| 2397 | |
|---|
| 2398 | if( 'post' == $post_key ){ |
|---|
| 2399 | $this->add_control( |
|---|
| 2400 | 'carousel_categories', |
|---|
| 2401 | [ |
|---|
| 2402 | 'label' => esc_html__( 'Categories', 'htmega-addons' ), |
|---|
| 2403 | 'type' => Controls_Manager::SELECT2, |
|---|
| 2404 | 'label_block' => true, |
|---|
| 2405 | 'multiple' => true, |
|---|
| 2406 | 'options' => htmega_get_taxonomies(), |
|---|
| 2407 | 'condition' =>[ |
|---|
| 2408 | 'carousel_post_type' => 'post', |
|---|
| 2409 | 'include_by' => 'in_category', |
|---|
| 2410 | ] |
|---|
| 2411 | ] |
|---|
| 2412 | ); |
|---|
| 2413 | } else if( 'product' == $post_key){ |
|---|
| 2414 | $this->add_control( |
|---|
| 2415 | 'carousel_prod_categories', |
|---|
| 2416 | [ |
|---|
| 2417 | 'label' => esc_html__( 'Categories', 'htmega-addons' ), |
|---|
| 2418 | 'type' => Controls_Manager::SELECT2, |
|---|
| 2419 | 'label_block' => true, |
|---|
| 2420 | 'multiple' => true, |
|---|
| 2421 | 'options' => htmega_get_taxonomies('product_cat'), |
|---|
| 2422 | 'condition' =>[ |
|---|
| 2423 | 'carousel_post_type' => 'product', |
|---|
| 2424 | 'include_by' => 'in_category', |
|---|
| 2425 | ] |
|---|
| 2426 | ] |
|---|
| 2427 | ); |
|---|
| 2428 | |
|---|
| 2429 | } else { |
|---|
| 2430 | $this->add_control( |
|---|
| 2431 | "{$post_key}_post_category", |
|---|
| 2432 | [ |
|---|
| 2433 | 'label' => esc_html__( 'Select Categories', 'htmega-addons' ), |
|---|
| 2434 | 'type' => Controls_Manager::SELECT2, |
|---|
| 2435 | 'label_block' => true, |
|---|
| 2436 | 'multiple' => true, |
|---|
| 2437 | 'options' => all_object_taxonomie_show_catagory($post_key), |
|---|
| 2438 | 'condition' => [ |
|---|
| 2439 | 'carousel_post_type' => $post_key, |
|---|
| 2440 | 'include_by' => 'in_category', |
|---|
| 2441 | ], |
|---|
| 2442 | ] |
|---|
| 2443 | ); |
|---|
| 2444 | } |
|---|
| 2445 | |
|---|
| 2446 | } |
|---|
| 2447 | $this->add_control( |
|---|
| 2448 | "exclude_posts", |
|---|
| 2449 | [ |
|---|
| 2450 | 'label' => esc_html__( 'Exclude Posts', 'htmega-addons' ), |
|---|
| 2451 | 'type' => Controls_Manager::TEXT, |
|---|
| 2452 | 'label_block' => true, |
|---|
| 2453 | 'placeholder' => esc_html__( 'Example: 10,11,105', 'htmega-addons' ), |
|---|
| 2454 | 'description' => esc_html__( "To Exclude Post, Enter the post id separated by ','", 'htmega-addons' ), |
|---|
| 2455 | ] |
|---|
| 2456 | ); |
|---|
| 2457 | $this->add_control( |
|---|
| 2458 | 'post_limit', |
|---|
| 2459 | [ |
|---|
| 2460 | 'label' => __('Limit', 'htmega-addons'), |
|---|
| 2461 | 'type' => Controls_Manager::NUMBER, |
|---|
| 2462 | 'default' => 5, |
|---|
| 2463 | 'separator'=>'before', |
|---|
| 2464 | ] |
|---|
| 2465 | ); |
|---|
| 2466 | |
|---|
| 2467 | $this->add_control( |
|---|
| 2468 | 'orderby', |
|---|
| 2469 | [ |
|---|
| 2470 | 'label' => esc_html__( 'Order By', 'htmega-addons' ), |
|---|
| 2471 | 'type' => Controls_Manager::SELECT, |
|---|
| 2472 | 'default' => 'date', |
|---|
| 2473 | 'options' => [ |
|---|
| 2474 | 'ID' => esc_html__('ID','htmega-addons'), |
|---|
| 2475 | 'date' => esc_html__('Date','htmega-addons'), |
|---|
| 2476 | 'name' => esc_html__('Name','htmega-addons'), |
|---|
| 2477 | 'title' => esc_html__('Title','htmega-addons'), |
|---|
| 2478 | 'comment_count' => esc_html__('Comment count','htmega-addons'), |
|---|
| 2479 | 'rand' => esc_html__('Random','htmega-addons'), |
|---|
| 2480 | ], |
|---|
| 2481 | ] |
|---|
| 2482 | ); |
|---|
| 2483 | $this->add_control( |
|---|
| 2484 | 'custom_order_by_date', |
|---|
| 2485 | [ |
|---|
| 2486 | 'label' => esc_html__( 'Custom Date', 'htmega-addons' ), |
|---|
| 2487 | 'type' => Controls_Manager::SWITCHER, |
|---|
| 2488 | 'return_value' => 'yes', |
|---|
| 2489 | 'default' => 'no', |
|---|
| 2490 | 'condition' =>[ |
|---|
| 2491 | 'orderby'=>'date' |
|---|
| 2492 | ] |
|---|
| 2493 | ] |
|---|
| 2494 | ); |
|---|
| 2495 | $this->add_control( |
|---|
| 2496 | 'order_by_date_before', |
|---|
| 2497 | [ |
|---|
| 2498 | 'label' => __( 'Before Date', 'htmega-addons' ), |
|---|
| 2499 | 'type' => Controls_Manager::DATE_TIME, |
|---|
| 2500 | 'condition' =>[ |
|---|
| 2501 | 'orderby'=>'date', |
|---|
| 2502 | 'custom_order_by_date'=>'yes', |
|---|
| 2503 | ] |
|---|
| 2504 | ] |
|---|
| 2505 | ); |
|---|
| 2506 | $this->add_control( |
|---|
| 2507 | 'order_by_date_after', |
|---|
| 2508 | [ |
|---|
| 2509 | 'label' => __( 'After Date', 'htmega-addons' ), |
|---|
| 2510 | 'type' => Controls_Manager::DATE_TIME, |
|---|
| 2511 | 'condition' =>[ |
|---|
| 2512 | 'orderby'=>'date', |
|---|
| 2513 | 'custom_order_by_date'=>'yes', |
|---|
| 2514 | ] |
|---|
| 2515 | ] |
|---|
| 2516 | ); |
|---|
| 2517 | $this->add_control( |
|---|
| 2518 | 'postorder', |
|---|
| 2519 | [ |
|---|
| 2520 | 'label' => esc_html__( 'Order', 'htmega-addons' ), |
|---|
| 2521 | 'type' => Controls_Manager::SELECT, |
|---|
| 2522 | 'default' => 'DESC', |
|---|
| 2523 | 'options' => [ |
|---|
| 2524 | 'DESC' => esc_html__('Descending','htmega-addons'), |
|---|
| 2525 | 'ASC' => esc_html__('Ascending','htmega-addons'), |
|---|
| 2526 | ], |
|---|
| 2527 | |
|---|
| 2528 | ] |
|---|
| 2529 | ); |
|---|
| 2530 | } |
|---|
| 2531 | |
|---|
| 2532 | } |
|---|
| 2533 | |
|---|