🔐 Sid Gifari File Manager Pro
v8.0.5 | 2026-06-14 13:42:56 | 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: text-marquee.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_Text_Marquee extends Widget_Base { public function get_name() { return 'nighty_elementor_text_marquee'; } public function get_title() { return esc_html__( 'Text Marquee', 'nighty' ); } public function get_icon() { return 'eicon-animation-text'; } public function get_categories() { return [ 'nighty' ]; } public function get_script_depends() { return [ '' ]; } // Add Your Controll In This Function protected function register_controls() { $this->start_controls_section( 'section_content', [ 'label' => esc_html__( 'Content', 'nighty' ), ] ); $this->add_control( 'icon', [ 'label' => esc_html__( 'Icon', 'nighty' ), 'type' => \Elementor\Controls_Manager::ICONS, 'default' => [ 'value' => 'flaticon flaticon-asterisks', 'library' => 'flaticon', ], ] ); $repeater = new \Elementor\Repeater(); $repeater->add_control( 'text', [ 'label' => esc_html__( 'Text', 'nighty' ), 'type' => \Elementor\Controls_Manager::TEXTAREA, 'default' => esc_html__( 'Your Text' , 'nighty' ), 'show_label' => true, ] ); $repeater->add_group_control( \Elementor\Group_Control_Typography::get_type(), [ 'name' => 'typography_content', 'selector' => '{{WRAPPER}} {{CURRENT_ITEM}}', ] ); $repeater->add_control( 'color', [ 'label' => esc_html__( 'Color', 'nighty' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} {{CURRENT_ITEM}}' => 'color: {{VALUE}}', ], ] ); $this->add_control( 'items', [ 'label' => esc_html__( 'Items', 'nighty' ), 'type' => \Elementor\Controls_Manager::REPEATER, 'fields' => $repeater->get_controls(), 'default' => [ [ 'text' => esc_html__( 'Open Hours : Mon-Fri: 9 AM – 6 PM Saturday: 9 AM – 4 PM Sunday: Closed','nighty' ), ], [ 'text' => esc_html__( 'Germany —785 15h Street, Office 478Berlin, De 81566', 'nighty' ), ], [ 'text' => esc_html__( 'Get In Touch — phone: +1(800)123-4566', 'nighty' ), ], ], ] ); $this->end_controls_section(); $this->start_controls_section( 'general_section_style', [ 'label' => esc_html__( 'General', 'nighty' ), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, ] ); $this->add_group_control( \Elementor\Group_Control_Background::get_type(), [ 'name' => 'general_background', 'types' => [ 'classic', 'gradient' ], 'selector' => '{{WRAPPER}} .ova-text-marquee', ] ); $this->add_responsive_control( 'general_opacity', [ 'label' => esc_html__( 'Opacity', 'nighty' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'size_units' => [ 'px' ], 'range' => [ 'px' => [ 'min' => 0.1, 'max' => 1, 'step' => 0.1, ], ], 'selectors' => [ '{{WRAPPER}} .ova-text-marquee' => 'opacity: {{SIZE}};', ], ] ); $this->add_responsive_control( 'general_padding', [ 'label' => esc_html__( 'Padding', 'nighty' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em', 'rem' ], 'selectors' => [ '{{WRAPPER}} .ova-text-marquee' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'icon_section_style', [ 'label' => esc_html__( 'Icon', 'nighty' ), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, ] ); $this->add_responsive_control( 'icon_size', [ 'label' => esc_html__( 'Size', 'nighty' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px' ], 'range' => [ 'px' => [ 'min' => 1, 'max' => 100, 'step' => 1, ] ], 'selectors' => [ '{{WRAPPER}} .ova-text-marquee .icon i' => 'font-size: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .ova-text-marquee .icon svg' => 'width: {{SIZE}}{{UNIT}};height: {{SIZE}}{{UNIT}};', ], ] ); $this->add_control( 'icon_color', [ 'label' => esc_html__( 'Color', 'nighty' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-text-marquee .icon i' => 'color : {{VALUE}};', '{{WRAPPER}} .ova-text-marquee .icon svg path' => 'fill : {{VALUE}};' ], ] ); $this->add_responsive_control( 'icon_margin', [ 'label' => esc_html__( 'Margin', 'nighty' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '{{WRAPPER}} .ova-text-marquee .icon' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'text_section_style', [ 'label' => esc_html__( 'Text', 'nighty' ), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, ] ); $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), [ 'name' => 'content_typography', 'selector' => '{{WRAPPER}} .ova-text-marquee .content .text', ] ); $this->add_control( 'text_color', [ 'label' => esc_html__( 'Text Color', 'nighty' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-text-marquee .content .text' => 'color: {{VALUE}}', ], ] ); $this->add_responsive_control( 'space_between', [ 'label' => esc_html__( 'Space Between', 'nighty' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'size_units' => [ 'px', '%', 'em', 'rem' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 1000, 'step' => 1, ], '%' => [ 'min' => 0, 'max' => 100, ], ], 'selectors' => [ '{{WRAPPER}} .ova-text-marquee .spacing' => 'width: {{SIZE}}{{UNIT}};', ], ] ); $this->add_control( 'time_duration', [ 'label' => esc_html__( 'Time Duration', 'nighty' ), 'type' => \Elementor\Controls_Manager::SELECT, 'default' => 'normal', 'options' => [ 'slow' => esc_html__( 'Slow', 'nighty' ), 'normal' => esc_html__( 'Normal', 'nighty' ), 'fast' => esc_html__( 'Fast', 'nighty' ), ], ] ); $this->add_control( 'direction', [ 'label' => esc_html__( 'Direction', 'nighty' ), 'type' => \Elementor\Controls_Manager::SELECT, 'default' => 'rtl', 'options' => [ 'ltr' => esc_html__( 'Left to Right', 'nighty' ), 'rtl' => esc_html__( 'Right to Left', 'nighty' ), ], ] ); $this->end_controls_section(); } // Render Template Here protected function render() { $settings = $this->get_settings(); $items = $settings['items']; $direction = $settings['direction']; $time_duration = $settings['time_duration']; ?> <div class="ova-text-marquee duration-<?php echo esc_attr($time_duration); ?> direction-<?php echo esc_attr($direction); ?>"> <?php if( is_array($items) && $items ) : ?> <div class="content content-wrapper"> <?php foreach($items as $item) { $item_id = 'elementor-repeater-item-' . $item['_id']; $text = $item['text']; ?> <span class="icon"> <?php \Elementor\Icons_Manager::render_icon( $settings['icon'], [ 'aria-hidden' => 'true' ] ); ?> </span> <span class="text <?php echo esc_attr( $item_id ); ?>"> <?php echo esc_html( $text ) . ' '; ?> </span> <?php } ?> </div> <div class="spacing"></div> <div class="content content-wrapper-2"> <?php foreach($items as $item) { $item_id = 'elementor-repeater-item-' . $item['_id']; $text = $item['text']; ?> <span class="icon"> <?php \Elementor\Icons_Manager::render_icon( $settings['icon'], [ 'aria-hidden' => 'true' ] ); ?> </span> <span class="text <?php echo esc_attr( $item_id ); ?>"> <?php echo esc_html( $text ) . ' '; ?> </span> <?php } ?> </div> <?php endif; ?> </div> <?php } } $widgets_manager->register( new Nighty_Elementor_Text_Marquee() );
💾 Save Changes
❌ Cancel