X7ROOT File Manager
Current Path:
/home/notabjze/boatingnight.com/wp-content/themes/yachbat/elementor/widgets
home
/
notabjze
/
boatingnight.com
/
wp-content
/
themes
/
yachbat
/
elementor
/
widgets
/
ðŸ“
..
📄
blog-2.php
(32.12 KB)
📄
blog-3.php
(32.14 KB)
📄
blog.php
(26.72 KB)
📄
button.php
(7.74 KB)
📄
contact-info-2.php
(18.51 KB)
📄
contact-info.php
(16.1 KB)
📄
counter.php
(11.48 KB)
📄
gallery.php
(10.01 KB)
📄
header-banner.php
(8.8 KB)
📄
heading.php
(7.44 KB)
📄
logo.php
(8.05 KB)
📄
menu-canvas.php
(5.35 KB)
📄
menu-footer.php
(4.41 KB)
📄
menu-nav.php
(6.68 KB)
📄
product-list.php
(23.39 KB)
📄
special-offer.php
(18.39 KB)
📄
switch-language.php
(4.66 KB)
📄
tabs.php
(60.94 KB)
📄
testimonial-carousel.php
(28.97 KB)
📄
toggle.php
(49.56 KB)
Editing: counter.php
<?php use Elementor\Widget_Base; use Elementor\Controls_Manager; use \Elementor\Group_Control_Typography; use \Elementor\Group_Control_Border; use Elementor\Utils; if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly class Yachbat_Elementor_Counter extends Widget_Base { public function get_name() { return 'yachbat_elementor_counter'; } public function get_title() { return esc_html__( 'Ova Counter', 'yachbat' ); } public function get_icon() { return 'eicon-counter'; } public function get_categories() { return [ 'yachbat' ]; } public function get_script_depends() { // appear js wp_enqueue_script( 'yachbat-counter-appear', get_theme_file_uri('/assets/libs/appear/appear.js'), array('jquery'), false, true); // Odometer for counter wp_enqueue_style( 'odometer', get_template_directory_uri().'/assets/libs/odometer/odometer.min.css' ); wp_enqueue_script( 'odometer', get_template_directory_uri().'/assets/libs/odometer/odometer.min.js', array('jquery'), false, true ); return [ 'yachbat-elementor-counter' ]; } // Add Your Controll In This Function protected function register_controls() { $this->start_controls_section( 'section_content', [ 'label' => esc_html__( 'Ova Counter', 'yachbat' ), ] ); // Add Class control $this->add_control( 'template', [ 'label' => esc_html__( 'Template', 'yachbat' ), 'type' => Controls_Manager::SELECT, 'default' => 'template1', 'options' => [ 'template1' => esc_html__('Template 1', 'yachbat'), 'template2' => esc_html__('Template 2', 'yachbat'), ] ] ); $this->add_control( 'class_icon', [ 'label' => esc_html__( 'Icon', 'yachbat' ), 'type' => Controls_Manager::ICONS, 'default' => [ 'value' => 'icomoon icomoon-steership', 'library' => 'icomoon', ], ] ); $this->add_control( 'number', [ 'label' => esc_html__( 'Number', 'yachbat' ), 'type' => Controls_Manager::NUMBER, 'default' => esc_html__( '657', 'yachbat' ), ] ); $this->add_control( 'suffix', [ 'label' => esc_html__( 'Suffix', 'yachbat' ), 'type' => Controls_Manager::TEXT, 'placeholder' => esc_html__( 'Plus', 'yachbat' ), ] ); $this->add_control( 'title', [ 'label' => esc_html__( 'Title', 'yachbat' ), 'type' => Controls_Manager::TEXT, 'default' => esc_html__( 'Satisfied Clients', 'yachbat' ), ] ); $this->add_responsive_control( 'align', [ 'label' => esc_html__( 'Alignment', 'yachbat' ), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'flex-start' => [ 'title' => esc_html__( 'Left', 'yachbat' ), 'icon' => 'eicon-text-align-left', ], 'center' => [ 'title' => esc_html__( 'Center', 'yachbat' ), 'icon' => 'eicon-text-align-center', ], 'flex-end' => [ 'title' => esc_html__( 'Right', 'yachbat' ), 'icon' => 'eicon-text-align-right', ], ], 'selectors' => [ '{{WRAPPER}} .ova-counter' => 'justify-content: {{VALUE}};', ], ] ); $this->end_controls_section(); /* Begin Counter Style */ $this->start_controls_section( 'counter_style', [ 'label' => esc_html__( 'Ova Counter', 'yachbat' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'counter_bgcolor', [ 'label' => esc_html__( 'Background Color', 'yachbat' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-counter' => 'background-color: {{VALUE}};', ], ] ); $this->add_responsive_control( 'counter_padding', [ 'label' => esc_html__( 'Padding', 'yachbat' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em' ], 'selectors' => [ '{{WRAPPER}} .ova-counter' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'counter_max_width', [ 'label' => esc_html__( 'Max Width', 'yachbat' ), 'type' => Controls_Manager::SLIDER, 'size_units' => ['px'], 'range' => [ 'px' => [ 'min' => 200, 'max' => 900, 'step' => 1, ], ], 'selectors' => [ '{{WRAPPER}} .ova-counter' => 'max-width: {{SIZE}}{{UNIT}};', ], ] ); $this->end_controls_section(); /* End counter style */ /* Begin icon Style */ $this->start_controls_section( 'icon_style', [ 'label' => esc_html__( 'Icon', 'yachbat' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_responsive_control( 'size_icon', [ 'label' => esc_html__( 'Size', 'yachbat' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px'], 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, 'step' => 1, ], ], 'selectors' => [ '{{WRAPPER}} .ova-counter .icon i' => 'font-size: {{SIZE}}{{UNIT}};', ], ] ); $this->add_control( 'icon_color', [ 'label' => esc_html__( 'Color', 'yachbat' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-counter .icon i' => 'color: {{VALUE}};', ], ] ); $this->add_control( 'icon_color_hover', [ 'label' => esc_html__( 'Color Hover', 'yachbat' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-counter:hover .icon i' => 'color: {{VALUE}};', ], ] ); $this->end_controls_section(); /* End icon style */ /* Begin title Style */ $this->start_controls_section( 'title_style', [ 'label' => esc_html__( 'Title', 'yachbat' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'title_typography', 'selector' => '{{WRAPPER}} .ova-counter .title', ] ); $this->add_control( 'title_color', [ 'label' => esc_html__( 'Color', 'yachbat' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-counter .title' => 'color: {{VALUE}};', ], ] ); $this->add_control( 'title_color_hover', [ 'label' => esc_html__( 'Color Hover', 'yachbat' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-counter:hover .title' => 'color: {{VALUE}};', ], ] ); $this->add_responsive_control( 'title_padding', [ 'label' => esc_html__( 'Padding', 'yachbat' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em' ], 'selectors' => [ '{{WRAPPER}} .ova-counter .title' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_group_control( \Elementor\Group_Control_Border::get_type(), [ 'name' => 'title_border', 'label' => esc_html__( 'Border', 'yachbat' ), 'selector' => '{{WRAPPER}} .ova-counter .title', ] ); $this->end_controls_section(); /* End title style */ /* Begin number (odometer) Style */ $this->start_controls_section( 'number_style', [ 'label' => esc_html__( 'Number', 'yachbat' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'number_typography', 'selector' => '{{WRAPPER}} .ova-counter .odometer', ] ); $this->add_control( 'number_color', [ 'label' => esc_html__( 'Color', 'yachbat' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-counter .odometer' => 'color: {{VALUE}};', ], ] ); $this->add_control( 'number_color_hover', [ 'label' => esc_html__( 'Color Hover', 'yachbat' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-counter:hover .odometer' => 'color: {{VALUE}};', ], ] ); $this->end_controls_section(); /* End number style */ /* Begin suffix Style */ $this->start_controls_section( 'suffix_style', [ 'label' => esc_html__( 'Suffix', 'yachbat' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'suffix_typography', 'selector' => '{{WRAPPER}} .ova-counter .suffix', ] ); $this->add_control( 'suffix_color', [ 'label' => esc_html__( 'Color', 'yachbat' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-counter .suffix' => 'color: {{VALUE}};', ], ] ); $this->add_control( 'suffix_color_hover', [ 'label' => esc_html__( 'Color Hover', 'yachbat' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-counter:hover .suffix' => 'color: {{VALUE}};', ], ] ); $this->add_responsive_control( 'suffix_padding', [ 'label' => esc_html__( 'Padding', 'yachbat' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em' ], 'selectors' => [ '{{WRAPPER}} .ova-counter .suffix' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_section(); /* End suffix style */ } // Render Template Here protected function render() { $settings = $this->get_settings(); $template = $settings['template']; $class_icon = $settings['class_icon']['value']; $number = isset( $settings['number'] ) ? $settings['number'] : '100'; $suffix = $settings['suffix']; $title = $settings['title']; ?> <div class="ova-counter ova-counter-<?php echo esc_attr( $template ); ?>" data-count="<?php echo esc_attr( $number ); ?>"> <?php if (!empty( $class_icon )): ?> <div class="icon"> <i class="<?php echo esc_attr( $class_icon ); ?>"></i> </div> <?php endif;?> <div class="counter-content"> <?php if ( $template === "template2" ) : ?> <?php if (!empty( $title )): ?> <h4 class="title"> <?php echo esc_html( $title ); ?> </h4> <?php endif;?> <?php endif;?> <span class="odometer">0</span><span class="suffix"><?php echo esc_html( $suffix ); ?></span> <?php if ( $template === "template1" ) : ?> <?php if (!empty( $title )): ?> <h4 class="title"> <?php echo esc_html( $title ); ?> </h4> <?php endif;?> <?php endif;?> </div> </div> <?php } } $widgets_manager->register_widget_type( new Yachbat_Elementor_Counter() );
Upload File
Create Folder