Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace FilixCore\Widgets;
- use Elementor\Widget_Base;
- use Elementor\Controls_Manager;
- use Elementor\Scheme_Color;
- use Elementor\Scheme_Typography;
- use Elementor\Group_Control_Typography;
- // Exit if accessed directly
- if ( ! defined( 'ABSPATH' ) ) {
- exit;
- }
- /**
- * Text Typing Effect
- *
- * Elementor widget for text typing effect.
- *
- * @since 1.7.0
- */
- class Filix_capabilities extends Widget_Base {
- public function get_name() {
- return 'Filix_capabilities_sec';
- }
- public function get_title() {
- return esc_html__( 'Capabilites', 'filix-core' );
- }
- public function get_icon() {
- return 'eicon-post-content';
- }
- public function get_keywords() {
- return [ 'capabilities', 'my', 'filix' ];
- }
- public function get_categories() {
- return [ 'filix-elements' ];
- }
- public function get_style_depends() {
- return ['animated-headline'];
- }
- public function get_script_depends() {
- return ['animated-headline'];
- }
- protected function _register_controls() {
- // ---------------------------------------- Title Section ------------------------------------//
- $this->start_controls_section(
- 'capa_section',
- [
- 'label' => esc_html__( 'Capabilities Section', 'filix-core' ),
- ]
- );
- $this->add_control(
- 'capa_section_title',
- [
- 'label' => esc_html__( 'Title Text', 'filix-core' ),
- 'type' => Controls_Manager::TEXT,
- 'label_block' => true,
- 'default' => 'My Capabilities',
- ]
- );
- $this->add_control(
- 'capa_animate_title',
- [
- 'label' => esc_html__( 'Section Animate Ttitle', 'filix-core' ),
- 'type' => Controls_Manager::TEXT,
- 'label_block' => true,
- 'default' => 'Capabilities',
- ]
- );
- $this->end_controls_section();
- /**
- * Style Tab
- * ------------------------------ Style Title ------------------------------
- */
- $this->start_controls_section(
- 'capa_style_title', [
- 'label' => esc_html__( 'Style Title', 'filix-core' ),
- 'tab' => Controls_Manager::TAB_STYLE,
- ]
- );
- $this->add_control(
- 'capa_color_title', [
- 'label' => esc_html__( 'Title Color', 'filix-core' ),
- 'type' => Controls_Manager::COLOR,
- 'selectors' => [
- '{{WRAPPER}} .capabiliti_wrap .capabiliti_title' => 'color: {{VALUE}};',
- ],
- 'defualt' => '#999',
- ]
- );
- $this->add_group_control(
- Group_Control_Typography::get_type(), [
- 'name' => 'capa_contnet_title',
- 'scheme' => Scheme_Typography::TYPOGRAPHY_1,
- 'selector' => '{{WRAPPER}} .capabiliti_title',
- ]
- );
- $this->end_controls_section();
- //------------------------------ Gradient Color ------------------------------
- $this->start_controls_section(
- 'about_style_background',
- [
- 'label' => esc_html__( 'Background', 'filix-core' ),
- 'tab' => Controls_Manager::TAB_STYLE
- ]
- );
- // Gradient Color
- $this->add_control(
- 'capa_bg_color', [
- 'label' => esc_html__( 'Background Color', 'filix-core' ),
- 'type' => Controls_Manager::COLOR,
- 'scheme' => [
- 'type' => Scheme_Color::get_type(),
- 'value' => Scheme_Color::COLOR_1,
- ],
- 'defualt' => '#000',
- 'selectors' => [
- '{{WRAPPER}} .capabiliti_wrap' => 'background: {{VALUE}};',
- ],
- ]
- );
- $this->end_controls_section();
- }
- protected function render() {
- $settings = $this->get_settings();
- ?>
- <section class="capabiliti_wrap">
- <div class="bg_text" >
- <?php if (!empty($settings['capa_animate_title'])) : ?>
- <h1 class="bg_strock_text" data-parallax='{"x": 200}'><?php echo wp_kses_post($settings['capa_animate_title']); ?></h1>
- <?php endif; ?>
- </div>
- <div class="container">
- <div class="row">
- <div class="col-lg-12 col-12">
- <?php if (!empty($settings['capa_section_title'])) : ?>
- <h2 class="capabiliti_title wow fadeInUp"><?php echo wp_kses_post($settings['capa_section_title']); ?></h2>
- <?php endif; ?>
- </div>
- </div>
- <div class="row">
- <div class="col-lg-5 col-md-4 col-sm-12 col-12">
- <ul class="nav nav-tabs capabiliti_tab">
- <?php
- $args = array(
- 'hide_empty'=> 1,
- 'orderby' => 'name',
- 'order' => 'ASC'
- );
- $counter = 0;
- $categories = get_categories($args);
- foreach($categories as $category){
- $counter++;
- ?>
- <li class="nav-item wow fadeInUp">
- <a class="nav-link <?=($counter == 1) ? 'active' : ''?>" data-toggle="tab" href="#<?php echo esc_attr($category->slug); ?>"><?php echo esc_html($category->name); ?></a>
- </li>
- <?php
- } ?>
- </ul>
- </div>
- <div class="col-lg-7 col-md-8 col-sm-12 col-12">
- <div class="tab-content capabiliti_tab_content">
- <?php
- $icon = function_exists('get_field') ? get_field('service_icon') : '';
- $counter = 0;
- foreach($categories as $category) {
- $counter++;
- ?>
- <div class="tab-pane fade show <?=($counter == 1) ? 'active' : ''?>" id="<?php echo esc_attr($category->slug); ?>">
- <div class="row">
- <?php
- $cat_slug = $category->slug;
- $the_query = new WP_Query(array(
- 'post_type' => 'acme_product',
- 'posts_per_page' => 4,
- 'category_name' => $cat_slug,
- ));
- ?>
- <?php while ( $the_query->have_posts() ) :
- $the_query->the_post(); ?>
- <div class="col-md-6 col-sm-6 col-12 wow fadeInUp">
- <div class="service_item">
- <div class="icon">
- <?php if(!empty($icon)) : ?>
- <i class="<?php echo $icon; ?>"></i>
- <?php endif; ?>
- </div>
- <div class="content">
- <a href="#"><h4><?php esc_html( the_title() ); ?></h4></a>
- <p><?php esc_html( the_conetnt() ); ?></p>
- </div>
- </div>
- </div>
- <?php endwhile; ?>
- </div>
- </div>
- <?php }
- ?>
- </div>
- </div>
- </div>
- </div>
- </section>
- <?php
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement