🔐 Sid Gifari File Manager Pro
v8.0.5 | 2026-06-14 13:42:34 | PHP 8.1.34
📂
/ (Root)
/
home
/
therahul
/
ramailobhela.com
/
wp-content
/
themes
/
nighty
/
elementor
/
widgets
📍 /home/therahul/ramailobhela.com/wp-content/themes/nighty/elementor/widgets
🔄 Refresh
✏️
Editing: counter.php
Writable
<?php use Elementor\Widget_Base; use Elementor\Controls_Manager; use Elementor\Group_Control_Typography; use Elementor\Utils; use Elementor\Group_Control_Border; if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly class Nighty_Elementor_Counter extends Widget_Base { public function get_name() { return 'nighty_elementor_counter'; } public function get_title() { return esc_html__( 'Ova Counter', 'nighty' ); } public function get_icon() { return 'eicon-counter'; } public function get_categories() { return [ 'nighty' ]; } public function get_script_depends() { // appear js wp_enqueue_script( 'nighty-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 [ 'nighty-elementor-counter' ]; } // Add Your Controll In This Function protected function register_controls() { $this->start_controls_section( 'section_content', [ 'label' => esc_html__( 'Ova Counter', 'nighty' ), ] ); $this->add_control( 'template', [ 'label' => esc_html__( 'Template', 'nighty' ), 'type' => \Elementor\Controls_Manager::SELECT, 'default' => 'template1', 'options' => [ 'template1' => esc_html__( 'Template 1', 'nighty' ), 'template2' => esc_html__( 'Template 2', 'nighty' ), ], ] ); $this->add_control( 'number', [ 'label' => esc_html__( 'Number', 'nighty' ), 'type' => Controls_Manager::NUMBER, 'default' => esc_html__( '1.6', 'nighty' ), ] ); $this->add_control( 'suffix', [ 'label' => esc_html__( 'Suffix', 'nighty' ), 'type' => Controls_Manager::TEXT, 'default' => 'K', ] ); $this->add_control( 'title', [ 'label' => esc_html__( 'Title', 'nighty' ), 'type' => Controls_Manager::TEXT, 'default' => esc_html__( 'Total Users', 'nighty' ), ] ); $this->add_responsive_control( 'text_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', ], ], 'default' => 'center', 'selectors' => [ '{{WRAPPER}} .ova-counter' => 'text-align: {{VALUE}};', ], ] ); $this->add_responsive_control( 'show_line_decoration', [ 'label' => esc_html__( 'Show Line Decoration', 'nighty' ), 'type' => \Elementor\Controls_Manager::SWITCHER, 'label_on' => esc_html__( 'Show', 'nighty' ), 'label_off' => esc_html__( 'Hide', 'nighty' ), 'return_value' => 'yes', 'default' => 'yes', ] ); $this->end_controls_section(); /* Begin Counter Style */ $this->start_controls_section( 'counter_style', [ 'label' => esc_html__( 'Ova Counter', 'nighty' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'counter_bgcolor', [ 'label' => esc_html__( 'Background', 'nighty' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-counter' => 'background: {{VALUE}};', ], ] ); $this->add_responsive_control( 'counter_padding', [ 'label' => esc_html__( 'Padding', 'nighty' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em' ], 'selectors' => [ '{{WRAPPER}} .ova-counter' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_group_control( \Elementor\Group_Control_Border::get_type(), [ 'name' => 'counter_border', 'selector' => '{{WRAPPER}} .ova-counter', ] ); $this->add_responsive_control( 'counter_border_radius', array( 'label' => esc_html__( 'Border Radius', 'nighty' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => array( 'px', '%' ), 'selectors' => array( '{{WRAPPER}} .ova-counter' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ), ) ); $this->end_controls_section(); /* End counter style */ /* Begin number (odometer) Style */ $this->start_controls_section( 'number_style', [ 'label' => esc_html__( 'Number', 'nighty' ), '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', 'nighty' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-counter .odometer' => 'color: {{VALUE}};', ], ] ); $this->add_responsive_control( 'number_padding', [ 'label' => esc_html__( 'Padding', 'nighty' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em' ], 'selectors' => [ '{{WRAPPER}} .ova-counter .odometer' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_section(); /* End number style */ /* Begin suffix Style */ $this->start_controls_section( 'suffix_style', [ 'label' => esc_html__( 'Suffix', 'nighty' ), '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', 'nighty' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-counter .suffix' => 'color: {{VALUE}};', ], ] ); $this->add_responsive_control( 'suffix_padding', [ 'label' => esc_html__( 'Padding', 'nighty' ), '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 */ /* Begin title Style */ $this->start_controls_section( 'title_style', [ 'label' => esc_html__( 'Title', 'nighty' ), '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', 'nighty' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-counter .title' => 'color: {{VALUE}};', ], ] ); $this->add_responsive_control( 'title_margin', [ 'label' => esc_html__( 'Margin', 'nighty' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em' ], 'selectors' => [ '{{WRAPPER}} .ova-counter .title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_section(); /* End title style */ /* Begin LINE DECORATION Style */ $this->start_controls_section( 'line_decoration_style', [ 'label' => esc_html__( 'Line Decoration', 'nighty' ), 'tab' => Controls_Manager::TAB_STYLE, 'condition' => [ 'show_line_decoration' => 'yes', ], ] ); $this->add_responsive_control( 'line_decoration_width', [ 'label' => esc_html__( 'Width', 'nighty' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'size_units' => [ 'px', '%', 'em', 'rem' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 300, 'step' => 1, ], '%' => [ 'min' => 0, 'max' => 100, ], ], 'selectors' => [ '{{WRAPPER}} .ova-counter .line-decoration' => 'width: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'line_decoration_height', [ 'label' => esc_html__( 'Height', 'nighty' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'size_units' => [ 'px', '%', 'em', 'rem' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 300, 'step' => 1, ], '%' => [ 'min' => 0, 'max' => 100, ], ], 'selectors' => [ '{{WRAPPER}} .ova-counter .line-decoration' => 'height: {{SIZE}}{{UNIT}};', ], ] ); $this->add_control( 'line_decoration_color', [ 'label' => esc_html__( 'Color', 'nighty' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-counter .line-decoration' => 'background-color: {{VALUE}};', ], ] ); $this->add_responsive_control( 'line_decoration_margin', [ 'label' => esc_html__( 'Margin', 'nighty' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em' ], 'selectors' => [ '{{WRAPPER}} .ova-counter .line-decoration' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_section(); /* End LINE DECORATION style */ } // Render Template Here protected function render() { $settings = $this->get_settings(); $template = $settings['template']; $number = isset( $settings['number'] ) ? $settings['number'] : '100'; $suffix = $settings['suffix']; $title = $settings['title']; $show_line_decoration = $settings['show_line_decoration']; ?> <div class="ova-counter <?php echo esc_attr($template); ?> " > <?php if($show_line_decoration == 'yes') : ?> <div class="line-decoration"></div> <?php endif; ?> <div class="wrap-content" data-count="<?php echo esc_attr( $number ); ?>" > <div class="odometer-wrapper"> <span class="odometer">0</span> <span class="suffix"> <?php echo esc_html( $suffix ); ?> </span> </div> <?php if (!empty( $title )): ?> <h4 class="title"> <?php echo esc_html( $title ); ?> </h4> <?php endif;?> </div> </div> <?php } } $widgets_manager->register( new Nighty_Elementor_Counter() );
💾 Save Changes
❌ Cancel