start_controls_section( 'section_content', [ 'label' => esc_html__( 'Content', 'nighty' ), ] ); $this->add_control( 'header_boxed_content', [ 'label' => esc_html__( 'Display Boxed Content', 'nighty' ), 'type' => Controls_Manager::SWITCHER, 'default' => 'no' ] ); $this->add_control( 'header_bg_source', [ 'label' => esc_html__( 'Display Background by Feature Image in Post/Page', 'nighty' ), 'type' => Controls_Manager::SWITCHER, 'default' => 'no' ] ); // Background Color $this->add_control( 'cover_color', [ 'label' => esc_html__( 'Background Cover Color', 'nighty' ), 'type' => Controls_Manager::COLOR, 'default' => 'rgba(0, 0, 0, 0.8)', 'description' => esc_html__( 'You can add background image in Advanced Tab', 'nighty' ), 'selectors' => [ '{{WRAPPER}} .cover_color' => 'background-color: {{VALUE}};', ], 'separator' => 'after' ] ); // Title $this->add_control( 'show_title', [ 'label' => esc_html__( 'Show Title', 'nighty' ), 'type' => Controls_Manager::SWITCHER, 'default' => 'yes', 'selector' => '{{WRAPPER}} .header_banner_el .header_title .wrap-title', ] ); $this->add_control( 'show_title_underline', [ 'label' => esc_html__( 'Show Title Underline', 'nighty' ), 'type' => Controls_Manager::SWITCHER, 'default' => 'yes', ] ); $this->add_control( 'title_color', [ 'label' => esc_html__( 'Title Color', 'nighty' ), 'type' => Controls_Manager::COLOR, 'default' => '#fff', 'selectors' => [ '{{WRAPPER}} .header_banner_el .header_title .wrap-title' => 'color: {{VALUE}};', ] ] ); $this->add_responsive_control( 'title_padding', [ 'label' => esc_html__( 'Title Padding', 'nighty' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '{{WRAPPER}} .header_banner_el .header_title' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_control( 'title_tag', [ 'label' => esc_html__( 'Choose Title Format', 'nighty' ), 'type' => Controls_Manager::SELECT, 'options' => [ 'h1' => esc_html__('H1', 'nighty'), 'h2' => esc_html__('H2', 'nighty'), 'h3' => esc_html__('H3', 'nighty'), 'h4' => esc_html__('H4', 'nighty'), 'h5' => esc_html__('H5', 'nighty'), 'h6' => esc_html__('H6', 'nighty'), 'div' => esc_html__('DIV', 'nighty'), ], 'default' => 'h1' ] ); $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), [ 'name' => 'header_title', 'label' => esc_html__( 'Title Typo', 'nighty' ), 'selector' => '{{WRAPPER}} .header_banner_el .header_title .wrap-title' ] ); // Breadcrumbs $this->add_control( 'show_breadcrumbs', [ 'label' => esc_html__( 'Show Breadcrumbs', 'nighty' ), 'type' => Controls_Manager::SWITCHER, 'default' => 'yes', 'selector' => '{{WRAPPER}} .header_breadcrumbs', 'separator' => 'before' ] ); $this->add_control( 'show_breadcrumbs_underline', [ 'label' => esc_html__( 'Show Breadcrumbs Underline', 'nighty' ), 'type' => Controls_Manager::SWITCHER, 'default' => 'yes', ] ); $this->add_control( 'breadcrumbs_color', [ 'label' => esc_html__( 'Breadcrumbs Color', 'nighty' ), 'type' => Controls_Manager::COLOR, 'default' => '#fff', 'selectors' => [ '{{WRAPPER}} .header_banner_el ul.breadcrumb li' => 'color: {{VALUE}};', '{{WRAPPER}} .header_banner_el ul.breadcrumb li a' => 'color: {{VALUE}};', '{{WRAPPER}} .header_banner_el ul.breadcrumb a' => 'color: {{VALUE}};', '{{WRAPPER}} .header_banner_el ul.breadcrumb li .separator i' => 'color: {{VALUE}};', ] ] ); $this->add_control( 'breadcrumbs_color_hover', [ 'label' => esc_html__( 'Breadcrumbs Color hover', 'nighty' ), 'type' => Controls_Manager::COLOR, 'default' => '#FF494F', 'selectors' => [ '{{WRAPPER}} .header_banner_el ul.breadcrumb li a:hover' => 'color: {{VALUE}};', ] ] ); $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), [ 'name' => 'header_breadcrumbs_typo', 'label' => esc_html__( 'Breadcrumbs Typography', 'nighty' ), 'selector' => '{{WRAPPER}} .header_banner_el ul.breadcrumb li' ] ); $this->add_responsive_control( 'breadcrumbs_padding', [ 'label' => esc_html__( 'Breadcrumbs Padding', 'nighty' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '{{WRAPPER}} .header_banner_el .header_breadcrumbs' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'breadcrumbs_margin', [ 'label' => esc_html__( 'Breadcrumbs Margin', 'nighty' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '{{WRAPPER}} .header_banner_el .header_breadcrumbs .breadcrumb' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); // Style $this->add_responsive_control( 'align', [ 'label' => esc_html__( 'Alignment', 'nighty' ), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'left' => [ 'title' => esc_html__( 'Left', 'nighty' ), 'icon' => 'eicon-text-align-left', ], 'center' => [ 'title' => esc_html__( 'Center', 'nighty' ), 'icon' => 'eicon-text-align-center', ], 'right' => [ 'title' => esc_html__( 'Right', 'nighty' ), 'icon' => 'eicon-text-align-right', ], ], 'selectors' => [ '{{WRAPPER}} .wrap_header_banner' => 'text-align: {{VALUE}};', '{{WRAPPER}} .wrap_header_banner ul.breadcrumb' => 'width: auto; display: initial;' ], 'default' => 'center', 'separator' => 'before' ] ); $this->add_control( 'class', [ 'label' => esc_html__( 'Class', 'nighty' ), 'type' => Controls_Manager::TEXT, ] ); $this->end_controls_section(); } /** * Render the widget output on the frontend. * * Written in PHP and used to generate the final HTML. * * @since 1.0.0 * * @access protected */ protected function render() { $settings = $this->get_settings(); $show_title_underline = $settings['show_title_underline']; $show_breadcrumbs_underline = $settings['show_breadcrumbs_underline']; $class_bg = $attr_style = ''; if( $settings['header_bg_source'] == 'yes' ){ $current_id = nighty_get_current_id(); $header_bg_source = get_the_post_thumbnail_url( $current_id, 'full' ); $class_bg = 'bg_feature_img'; $attr_style = 'style="background: url( '.$header_bg_source.' )" '; } $align = isset( $settings['align'] ) ? $settings['align'] : ''; ?>
>
">
< class="header_title"> "> >
register( new Nighty_Elementor_Header_Banner() );