Aew_content_layout_options(); $this->Aew_content_order_options(); $this->Aew_content_category_options(); $this->Aew_content_image_options(); $this->Aew_content_title_options(); $this->Aew_content_excerpt_options(); $this->Aew_content_disclaimer_options(); $this->Aew_content_readmore_options(); $this->Aew_promotion_style_layout_options(); $this->Aew_promotion_style_box_options(); $this->Aew_promotion_style_image_options(); $this->Aew_promotion_style_title_options(); $this->Aew_promotion_style_content_options(); $this->Aew_promotion_customfield_options(); $this->Aew_promotion_style_readmore_options(); } /** * Content Layout Options. */ private function Aew_content_layout_options() { $this->start_controls_section( 'section_layout', [ 'label' => esc_html__( 'Layout', 'alley-elementor-widget' ), ] ); $this->add_control( 'select_layout', [ 'label' => __( 'Grid Style', 'alley-elementor-widget' ), 'type' => Controls_Manager::SELECT, 'default' => '1', 'options' => [ '1' => esc_html__( 'Layout 1', 'alley-elementor-widget' ), '2' => esc_html__( 'Layout 2', 'alley-elementor-widget' ), ], ] ); $this->add_control( 'posts_per_page', [ 'label' => __( 'Posts Per Page', 'alley-elementor-widget' ), 'type' => Controls_Manager::NUMBER, 'default' => 5 ] ); $this->end_controls_section(); } /** * disclaimer Layout Options. */ private function Aew_content_disclaimer_options(){ $this->start_controls_section( 'disclaimr_section', [ 'label' => __( 'Disclaimer Show/hide', 'alley-elementor-widget' ), 'tab' => Controls_Manager::TAB_CONTENT, ] ); $this->add_control( 'show_disclaimer', [ 'label' => __( 'Disclaimer', 'alley-elementor-widget' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => __( 'Show', 'alley-elementor-widget' ), 'label_off' => __( 'Hide', 'alley-elementor-widget' ), 'default' => 'yes', 'separator' => 'before', ] ); $this->end_controls_section(); } /** * Style Layout Options. */ private function Aew_promotion_style_layout_options() { // Layout. $this->start_controls_section( 'section_layout_style', [ 'label' => __( 'Layout', 'alley-elementor-widget' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); // Columns margin. $this->add_control( 'grid_style_columns_margin', [ 'label' => __( 'Columns margin', 'alley-elementor-widget' ), 'type' => Controls_Manager::SLIDER, 'default' => [ 'size' => 15, ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, ], ], 'selectors' => [ '{{WRAPPER}} .promotion-block' => 'grid-column-gap: {{SIZE}}{{UNIT}}', ], ] ); // Row margin. $this->add_control( 'grid_style_rows_margin', [ 'label' => __( 'Rows margin', 'alley-elementor-widget' ), 'type' => Controls_Manager::SLIDER, 'default' => [ 'size' => 30, ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, ], ], 'selectors' => [ '{{WRAPPER}} .promotion-block' => 'grid-row-gap: {{SIZE}}{{UNIT}}', ], ] ); $this->end_controls_section(); } /** * Style Box Options. */ private function Aew_promotion_style_box_options() { // Box. $this->start_controls_section( 'section_style_box', [ 'label' => __( 'Box', 'alley-elementor-widget' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); // Box alignment $this->add_control( 'content_align', [ 'label' => __( 'Alignment', 'alley-elementor-widget' ), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'left' => [ 'title' => __( 'Left', 'alley-elementor-widget' ), 'icon' => 'fa fa-align-left', ], 'center' => [ 'title' => __( 'Center', 'alley-elementor-widget' ), 'icon' => 'fa fa-align-center', ], 'right' => [ 'title' => __( 'Right', 'alley-elementor-widget' ), 'icon' => 'fa fa-align-right', ], ], 'default' => 'left', 'selectors' => [ '{{WRAPPER}} .promotion-block .promotion-holder .summary' => 'text-align: {{VALUE}};', ], 'separator' => 'before', ] ); // Box internal padding. $this->add_responsive_control( 'grid_items_style_padding', [ 'label' => __( 'Padding', 'alley-elementor-widget' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%' ], 'selectors' => [ '{{WRAPPER}} .promotion-block .promotion-holder' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}', ], ] ); // Box color $this->add_control( 'box_style_color', [ 'type' => Controls_Manager::COLOR, 'label' => __( 'Box Color', 'alley-elementor-widget' ), 'scheme' => [ 'type' => Color::get_type(), 'value' => Color::COLOR_1, ], 'default' => 'rgba(255, 255, 255, 1)', 'selectors' => [ '{{WRAPPER}} .promotion-block .promotion-holder,.promotions-layout-5 .promotion-block .promotion-holder .summary' => 'background: {{VALUE}};', ], ] ); $this->start_controls_tabs( 'box_style_tabs' ); // Normal tab. $this->start_controls_tab( 'box_style_tabs_normal', [ 'label' => __( 'Normal', 'alley-elementor-widget' ), ] ); // Normal border $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'border', 'label' => __( 'Border', 'alley-elementor-widget' ), 'selector' => '{{WRAPPER}} .promotion-block .promotion-holder', ] ); // Normal border shadow $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => 'box_shadow', 'label' => __( 'Box Shadow', 'alley-elementor-widget' ), 'selector' => '{{WRAPPER}} .promotion-block .promotion-holder', ] ); // Normal border radius $this->add_control( 'border_radius', [ 'label' => __( 'Border Radius', 'elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%' ], 'selectors' => [ '{{WRAPPER}} .promotion-block .promotion-holder' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_tab(); // Hover border. $this->start_controls_tab( 'box_style_tabs_hover', [ 'label' => __( 'Hover', 'alley-elementor-widget' ), ] ); // Hover border shadow $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'border_hover', 'label' => __( 'Border', 'alley-elementor-widget' ), 'selector' => '{{WRAPPER}} .promotion-block .promotion-holder:hover', ] ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => 'box_shadow_hover', 'label' => __( 'Box Shadow', 'plugin-domain' ), 'selector' => '{{WRAPPER}} .promotion-block .promotion-holder:hover', ] ); // Hover border radius $this->add_control( 'border_radius_hover', [ 'label' => __( 'Border Radius', 'elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%' ], 'selectors' => [ '{{WRAPPER}} .promotion-block .promotion-holder:hover' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->end_controls_section(); } /** * Style Image Options. */ private function Aew_promotion_style_image_options() { // Box. $this->start_controls_section( 'section_image', [ 'label' => __( 'Image', 'alley-elementor-widget' ), 'tab' => Controls_Manager::TAB_STYLE, 'condition' => [ 'show_image' => 'yes', ], ] ); $this->add_responsive_control( 'grid_style_image_margin', [ 'label' => __( 'Margin', 'alley-elementor-widget' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px' ], 'selectors' => [ '{{WRAPPER}} .promotion-holder .img-holder img' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->start_controls_tabs( 'image_box_style_tabs' ); // Normal tab. $this->start_controls_tab( 'image_box_style_tabs_normal', [ 'label' => __( 'Normal', 'alley-elementor-widget' ), ] ); // Normal border $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'image_border', 'label' => __( 'Border', 'alley-elementor-widget' ), 'selector' => '{{WRAPPER}} .promotion-holder .img-holder img', ] ); // Normal border shadow $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => 'image_box_shadow', 'label' => __( 'Box Shadow', 'alley-elementor-widget' ), 'selector' => '{{WRAPPER}} .promotion-holder .img-holder img', ] ); // Normal border radius $this->add_control( 'image_border_radius_hover', [ 'label' => __( 'Border Radius', 'elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%' ], 'selectors' => [ '{{WRAPPER}} .promotion-holder .img-holder img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_tab(); // Hover border. $this->start_controls_tab( 'image_box_style_tabs_hover', [ 'label' => __( 'Hover', 'alley-elementor-widget' ), ] ); // Hover border shadow $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'image_border_hover', 'label' => __( 'Border', 'alley-elementor-widget' ), 'selector' => '{{WRAPPER}} .promotion-holder .img-holder img:hover', ] ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => 'image_box_shadow_hover', 'label' => __( 'Box Shadow', 'plugin-domain' ), 'selector' => '{{WRAPPER}} .promotion-holder .img-holder img:hover', ] ); // Hover border radius $this->add_control( 'image_border_radius', [ 'label' => __( 'Border Radius', 'elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%' ], 'selectors' => [ '{{WRAPPER}} .promotion-holder .img-holder img:hover' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->end_controls_section(); } /** * Style > Title. */ private function Aew_promotion_style_title_options() { // Tab. $this->start_controls_section( 'section_grid_title_style', [ 'label' => __( 'Title', 'alley-elementor-widget' ), 'tab' => Controls_Manager::TAB_STYLE, 'condition' => [ 'show_title' => 'yes', ], ] ); // Title typography. $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'grid_title_style_typography', 'scheme' => Typography::TYPOGRAPHY_1, 'selector' => '{{WRAPPER}} .promotion-block .promotion-holder .post-title', ] ); // Title color. $this->add_control( 'grid_title_style_color', [ 'type' => Controls_Manager::COLOR, 'label' => __( 'Text Color', 'alley-elementor-widget' ), 'scheme' => [ 'type' => Color::get_type(), 'value' => Color::COLOR_1, ], 'default' => '#000000', 'selectors' => [ '{{WRAPPER}} .promotion-block .promotion-holder .post-title a' => 'color: {{VALUE}};', ], ] ); // Title color. $this->add_control( 'grid_title_hoverstyle_color', [ 'type' => Controls_Manager::COLOR, 'label' => __( 'Hover Color', 'alley-elementor-widget' ), 'scheme' => [ 'type' => Color::get_type(), 'value' => Color::COLOR_1, ], 'separator' => '', 'default' => '#000000', 'selectors' => [ '{{WRAPPER}} .promotion-block .promotion-holder .post-title a:hover' => 'color: {{VALUE}};', ], ] ); // Title margin. $this->add_responsive_control( 'grid_title_style_margin', [ 'label' => __( 'Margin', 'alley-elementor-widget' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px' ], 'selectors' => [ '{{WRAPPER}} .promotion-block .promotion-holder .post-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_section(); } /** * Style > Content. */ private function Aew_promotion_style_content_options() { // Tab. $this->start_controls_section( 'section_grid_content_style', [ 'label' => __( 'Content', 'alley-elementor-widget' ), 'tab' => Controls_Manager::TAB_STYLE, 'condition' => [ 'show_excerpt' => 'yes', ], ] ); // Content typography. $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'grid_content_style_typography', 'scheme' => Typography::TYPOGRAPHY_1, 'selector' => '{{WRAPPER}} .promotion-block .promotion-holder p', ] ); // Content color. $this->add_control( 'grid_content_style_color', [ 'type' => Controls_Manager::COLOR, 'label' => __( 'Color', 'alley-elementor-widget' ), 'scheme' => [ 'type' => Color::get_type(), 'value' => Color::COLOR_1, ], 'default' => '#000000', 'selectors' => [ '{{WRAPPER}} .promotion-block .promotion-holder p' => 'color: {{VALUE}};', ], ] ); // Content margin $this->add_responsive_control( 'grid_content_style_margin', [ 'label' => __( 'Margin', 'alley-elementor-widget' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px' ], 'selectors' => [ '{{WRAPPER}} .promotion-block .promotion-holder p' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_section(); } /** * Style metafield Options. */ private function Aew_promotion_customfield_options() { // Category. $this->start_controls_section( 'section_style_customfield', [ 'label' => __( 'Disclaimer', 'alley-elementor-widget' ), 'tab' => Controls_Manager::TAB_STYLE, 'condition' => [ 'show_disclaimer' => 'yes', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'customfield_style_typography', 'scheme' => Typography::TYPOGRAPHY_1, 'selector' => '{{WRAPPER}} .promotion-block .promotion-holder .disclaimer', ] ); // customfield internal padding. $this->add_responsive_control( 'customfield_style_margin', [ 'label' => __( 'Margin', 'alley-elementor-widget' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%' ], 'selectors' => [ '{{WRAPPER}} .promotion-block .promotion-holder .disclaimer' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}', ], ] ); $this->start_controls_tabs( 'customfield_style_tabs' ); // Normal tab. $this->start_controls_tab( 'customfield_style_normal_tabs', [ 'label' => __( 'Normal', 'alley-elementor-widget' ), ] ); // Normal customfield text color. $this->add_control( 'customfield_normal_text_color', [ 'type' => Controls_Manager::COLOR, 'label' => __( 'Text Color', 'alley-elementor-widget' ), 'scheme' => [ 'type' => Color::get_type(), 'value' => Color::COLOR_1, ], 'separator' => '', 'selectors' => [ '{{WRAPPER}} .promotion-block .promotion-holder .disclaimer' => 'color: {{VALUE}};', ], ] ); $this->end_controls_tab(); // Hover tab. $this->start_controls_tab( 'customfield_style_hover_tabs', [ 'label' => __( 'Hover', 'alley-elementor-widget' ), ] ); // Hover customfield text color. $this->add_control( 'customfield_style_hover_text_color', [ 'type' => Controls_Manager::COLOR, 'label' => __( 'Text Color', 'alley-elementor-widget' ), 'scheme' => [ 'type' => Color::get_type(), 'value' => Color::COLOR_1, ], 'separator' => '', 'selectors' => [ '{{WRAPPER}} .promotion-block .promotion-holder .disclaimer:hover' => 'color: {{VALUE}};', ], ] ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->end_controls_section(); } /** * Style > Readmore. */ private function Aew_promotion_style_readmore_options() { // Tab. $this->start_controls_section( 'section_grid_readmore_style', [ 'label' => __( 'Read More', 'alley-elementor-widget' ), 'tab' => Controls_Manager::TAB_STYLE, 'condition' => [ 'show_read_more' => 'yes', ], ] ); // Readmore typography. $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'grid_readmore_style_typography', 'scheme' => Typography::TYPOGRAPHY_1, 'selector' => '{{WRAPPER}} .promotion-block .promotion-holder a.apply-btn', ] ); // Readmore margin $this->add_responsive_control( 'grid_readmore_style_margin', [ 'label' => __( 'Margin', 'alley-elementor-widget' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px' ], 'selectors' => [ '{{WRAPPER}} .promotion-block .promotion-holder a.apply-btn' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); // Read More Button Padding $this->add_responsive_control( 'grid_items_readmore_padding', [ 'label' => __( 'Padding', 'alley-elementor-widget' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%' ], 'selectors' => [ '{{WRAPPER}} .promotion-block .promotion-holder a.apply-btn' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}', ], ] ); // Normal border radius $this->add_control( 'border_button_radius', [ 'label' => __( 'Border Radius', 'elementor' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%' ], 'selectors' => [ '{{WRAPPER}} .promotion-block .promotion-holder a.apply-btn' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->start_controls_tabs( 'readmore_style_tabs' ); // Normal tab. $this->start_controls_tab( 'readmore_style_normal_tabs', [ 'label' => __( 'Normal', 'alley-elementor-widget' ), ] ); //Read More background color $this->add_control( 'grid_readmore_bg_color', [ 'type' => Controls_Manager::COLOR, 'label' => __( 'Background Color', 'alley-elementor-widget' ), 'scheme' => [ 'type' => Color::get_type(), 'value' => Color::COLOR_1, ], 'default' => 'rgba(255, 255, 255, 0)', 'selectors' => [ '{{WRAPPER}} .promotion-block .promotion-holder a.apply-btn' => 'background: {{VALUE}};', ], ] ); // Readmore color. $this->add_control( 'grid_readmore_style_color', [ 'type' => Controls_Manager::COLOR, 'label' => __( 'Color', 'alley-elementor-widget' ), 'scheme' => [ 'type' => Color::get_type(), 'value' => Color::COLOR_1, ], 'selectors' => [ '{{WRAPPER}} .promotion-block .promotion-holder a.apply-btn' => 'color: {{VALUE}};', ], ] ); $this->end_controls_tab(); // Hover tab. $this->start_controls_tab( 'readmore_style_hover_tabs', [ 'label' => __( 'Hover', 'alley-elementor-widget' ), ] ); //Read More Hover background color $this->add_control( 'grid_readmore_bg_hover_color', [ 'type' => Controls_Manager::COLOR, 'label' => __( 'Background Color', 'alley-elementor-widget' ), 'scheme' => [ 'type' => Color::get_type(), 'value' => Color::COLOR_1, ], 'default' => 'rgba(255, 255, 255, 0)', 'selectors' => [ '{{WRAPPER}} .promotion-block .promotion-holder a.apply-btn:hover' => 'background: {{VALUE}};', ], ] ); //Hover Readmore color. $this->add_control( 'grid_readmore_hover_style_color', [ 'type' => Controls_Manager::COLOR, 'label' => __( 'Color', 'alley-elementor-widget' ), 'scheme' => [ 'type' => Color::get_type(), 'value' => Color::COLOR_1, ], 'selectors' => [ '{{WRAPPER}} .promotion-block .promotion-holder a.apply-btn:hover' => 'color: {{VALUE}};', ], ] ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->end_controls_section(); } protected function render( $instance = [] ) { // Get settings. $settings = $this->get_settings(); $select_layout =$settings['select_layout']; ?>
'service_tag', 'field' => 'id', 'terms' => $cat_terms, //the taxonomy terms I'd like to dynamically query ), ); } $query_args = array( 'posts_per_page' => absint( $posts_per_page ), 'post_type' => 'abt_promotion', 'no_found_rows' => true, 'post__not_in' => get_option( 'sticky_posts' ), 'ignore_sticky_posts' => true, 'order' => $order, 'orderby' => $orderby, 'tax_query' => $tax_query, ); $all_posts = new \WP_Query( $query_args ); if ( $all_posts->have_posts() ) : include( AEW_PlLUGIN_DIR . 'frontend/layouts/promotion-layout.php' ); endif; ?>