<?php
use Elementor\Widget_Base;
use Elementor\Controls_Manager;
use Elementor\Repeater;
use Elementor\Scheme_Color;
use Elementor\Group_Control_Typography;
Use Elementor\Core\Schemes\Typography;
use Elementor\Group_Control_Border;
use Elementor\Utils;
use Elementor\Group_Control_Text_Shadow;

if (!defined('ABSPATH')) exit; // Exit if accessed directly
if(!function_exists('widgetkit_pro_array_get')) {
    function widgetkit_pro_array_get($array, $key, $default=null){
        if(!is_array($array)) return $default;
        return array_key_exists($key, $array) ? $array[$key] : $default;
    }
}

/**
 * magmax Layout
 * =============
 */
class Widgetkit_Pro_Single_Category_with_Dynamic_Carousel extends Widget_Base
{

    public function get_name()
    {
        return 'magmax-single-category';
    }

    public function get_title()
    {
        return __('Single Category with Dynamic Carousel', 'widgetkit-pro');
    }

    public function get_icon()
    {
        return 'eicon-post-navigation';
    }

    public function get_categories()
    {
        return ['widgetkit_pro'];
    }

    /**
     * A list of scripts that the widgets is depended in
     *
     * @since 1.3.0
     **/
    /*
        public function get_script_depends() {
            return [ 'imagesloaded' ];
        }
    */

    protected function register_controls()
    {
        $terms = get_terms( array(
            'taxonomy' => 'category',
            'hide_empty' => false,
        ) );
        $cat_names = array();
        foreach( $terms as $t ):
            $cat_names[$t->term_id] = $t->name;
        endforeach;

        /* slides content title subtitle button and button link */
        $this->start_controls_section(
            'section_tab',
            [
                'label' => __('Layout', 'widgetkit-pro'),
                'class' => __('Single Category Dynamic layout', 'widgetkit-pro'),
            ]
        );
        $this->add_control(
            'single_layout_header_enable',
            [
                'label' => __( 'Layout Header', 'widgetkit-pro' ),
                'type' => Controls_Manager::SWITCHER,
                'default' => '',
                'description' => 'Layout header disable or enable',
                'label_on' => __( 'Yes', 'widgetkit-pro' ),
                'label_off' => __( 'No', 'widgetkit-pro' ),
                'return_value' => 'yes',
            ]
        );
        $this->add_control(
            'single_layout_title',
            [
                'label'       => __( 'Title', 'widgetkit-pro' ),
                'type'        => Controls_Manager::TEXT,
                'default'     => __( 'Layout title text', 'widgetkit-pro' ),
                'placeholder' => __( 'Type your layout title text here', 'widgetkit-pro' ),
                'condition' => [
                    'single_layout_header_enable' => 'yes',
                ]
            ]
        );
        $this->add_control(
            'layout_style',
            [
                'label'       => __( 'Layout Style', 'widgetkit-pro' ),
                'type' => Controls_Manager::SELECT,
                'default' => 'single-category-dynamic-carousel-layout-1',
                'options' => [
                    'single-category-dynamic-carousel-layout-1'  => __( 'Layout 1', 'widgetkit-pro' ),
                    'single-category-dynamic-carousel-layout-2'  => __( 'Layout 2', 'widgetkit-pro' ),
                    'single-category-dynamic-carousel-layout-3'  => __( 'Layout 3', 'widgetkit-pro' ),
                ],
            ]
        );

        $this->add_control(
            'cat_single_id',
            [
                'label' => __( 'Category List', 'widgetkit-pro' ),
                'type' => Controls_Manager::SELECT,
                'options' => $cat_names,
            ]
        );
        $this->add_control(
            'regular_thumbnail_size',
            [
                'label'       => __( 'Thumbnail Size', 'widgetkit-pro' ),
                'type' => Controls_Manager::SELECT,
                'default' => 'large',
                'options' => [
                    'medium'  => __( 'Medium', 'widgetkit-pro' ),
                    'medium_large'  => __( 'Medium Large', 'widgetkit-pro' ),
                    'large'  => __( 'Large', 'widgetkit-pro' ),
                    'full'  => __( 'Full', 'widgetkit-pro' ),
                ],
            ]
        );
        $this->add_control(
            'highlight_first_post',
            [
                'label' => __( 'Highlight Post', 'widgetkit-pro' ),
                'type' => Controls_Manager::SWITCHER,
                'default' => '',
                'description' => 'Highlight 1st post from the list',
                'label_on' => __( 'Yes', 'widgetkit-pro' ),
                'label_off' => __( 'No', 'widgetkit-pro' ),
                'return_value' => 'yes',
            ]
        );
        $this->add_control(
            'featured_thumbnail_size',
            [
                'label'       => __( 'Highlighted Thumbnail Size', 'widgetkit-pro' ),
                'type' => Controls_Manager::SELECT,
                'default' => 'large',
                'options' => [
                    'medium'  => __( 'Medium', 'widgetkit-pro' ),
                    'medium_large'  => __( 'Medium Large', 'widgetkit-pro' ),
                    'large'  => __( 'Large', 'widgetkit-pro' ),
                    'full'  => __( 'Full', 'widgetkit-pro' ),
                ],
                'condition' => [
                    'highlight_first_post' => 'yes',
                ]
            ]
        );
        $this->add_control(
            'featured-post-min-height',
            [
                'label' => __( 'Featured Post Min Height', 'widgetkit-pro' ),
                'type' => Controls_Manager::SLIDER,
                'range' => [
                    'px' => [
                        'min' => 200,
                        'max' => 1500,
                        'step' => 1,
                    ],
                ],
                'size_units' => [ 'px' ],
                'selectors' => [
                    '{{WRAPPER}} .single-category-dynamic-carousel-layout-1 .featured-post .post-thumb a img' => 'height: {{SIZE}}{{UNIT}};',
                    '{{WRAPPER}} .single-category-dynamic-carousel-layout-2 .featured-post .post-thumb a img' => 'height: {{SIZE}}{{UNIT}};',
                    '{{WRAPPER}} .single-category-dynamic-carousel-layout-3 .featured-post .post-thumb a img' => 'height: {{SIZE}}{{UNIT}};',
                ]
            ]
        );
        $this->add_control(
            'featured_thumbnail_style',
            [
                'label'       => __( 'Highlighted Thumbnail Style', 'widgetkit-pro' ),
                'type' => Controls_Manager::SELECT,
                'default' => 'list',
                'options' => [
                    'list'  => __( 'List', 'widgetkit-pro' ),
                    'tiles'  => __( 'Tiles', 'widgetkit-pro' ),
                ],
                'condition' => [
                    'layout_style' => ['single-category-dynamic-carousel-layout-1', 'single-category-dynamic-carousel-layout-2'],
                ]
            ]
        );
        $this->add_control(
            'show_highlight_cat_tag',
            [
                'label' => __( 'Category Tag for Highlight Post', 'widgetkit-pro' ),
                'type' => Controls_Manager::SWITCHER,
                'default' => '',
                'description' => 'Show category tag for highlight post above the title',
                'label_on' => __( 'Show', 'widgetkit-pro' ),
                'label_off' => __( 'Hide', 'widgetkit-pro' ),
                'return_value' => 'yes',
                'condition' => [
                    'highlight_first_post' => 'yes',
                ]
            ]
        );
        $this->add_control(
            'show_regular_thumbnail',
            [
                'label' => __( 'Show Regular Post Thumbnial', 'widgetkit-pro' ),
                'type' => Controls_Manager::SWITCHER,
                'default' => 'yes',
                'description' => 'Show regular post thumbnail in the list',
                'label_on' => __( 'Yes', 'widgetkit-pro' ),
                'label_off' => __( 'No', 'widgetkit-pro' ),
                'return_value' => 'yes',
            ]
        );
        $this->add_control(
            'show_cat_tag',
            [
                'label' => __( 'Regular Category Tag', 'widgetkit-pro' ),
                'type' => Controls_Manager::SWITCHER,
                'default' => '',
                'description' => 'Show category tag above the title',
                'label_on' => __( 'Show', 'widgetkit-pro' ),
                'label_off' => __( 'Hide', 'widgetkit-pro' ),
                'return_value' => 'yes',
            ]
        );
        $this->add_control(
            'post_num_to_show',
            [
                'label'   => __( 'Number of Post to Show', 'widgetkit-pro' ),
                'type'    => Controls_Manager::NUMBER,
                'default' => 5,
                'min'     => -1,
                'max'     => 100,
                'step'    => 1,
            ]
        );
        $this->add_control(
            'regular_post_grid',
            [
                'label'       => __( 'Regular Post Grid', 'widgetkit-pro' ),
                'type' => Controls_Manager::SELECT,
                'default' => '1',
                'options' => [
                    '1'  => __( '1', 'widgetkit-pro' ),
                    '2'  => __( '2', 'widgetkit-pro' ),
                    '3'  => __( '3', 'widgetkit-pro' ),
                    '4'  => __( '4', 'widgetkit-pro' ),
                ],
            ]
        );
        $this->add_control(
            'regular_post_style',
            [
                'label'       => __( 'Regular Post Grid', 'widgetkit-pro' ),
                'type' => Controls_Manager::SELECT,
                'default' => 'horizontal',
                'options' => [
                    'vertical'  => __( 'Vertical', 'widgetkit-pro' ),
                    'horizontal'  => __( 'Horizontal', 'widgetkit-pro' ),
                ],
            ]
        );
        $this->add_control(
            'title_word',
            [
                'label'       => __( 'Title Word Count', 'widgetkit-pro' ),
                'type'    => Controls_Manager::NUMBER,
                'default' => 7,
                'min'     => 5,
                'max'     => 100,
                'step'    => 1,
                'condition' => [
                    'layout_style' => ['single-category-dynamic-carousel-layout-2', 'single-category-dynamic-carousel-layout-3'],
                ]
            ]
        );


        $this->end_controls_section();


        /**
         * Style tab
         * =============
         */
        $this->start_controls_section(
            'section_style',
            [
                'label' => __( 'Typography', 'widgetkit-pro' ),
                'tab' => Controls_Manager::TAB_STYLE,
            ]
        );
        $this->add_control(
            'section_title',
            [
                'label' => __( 'Section Title', 'widgetkit-pro' ),
                'type' => Controls_Manager::HEADING,
                'separator' => 'before',
            ]
        );
        $this->add_group_control(
            Group_Control_Typography::get_type(),
            [
                'label' => __( 'Section Title', 'widgetkit-pro' ),
                'name' => 'section_title_typography',
                'selector' => '{{WRAPPER}} .single-layout .layout-title h4',
            ]
        );
        $this->add_control(
            'highlight_title',
            [
                'label' => __( 'Highlight Post Title', 'widgetkit-pro' ),
                'type' => Controls_Manager::HEADING,
                'separator' => 'before',
            ]
        );
        $this->add_group_control(
            Group_Control_Typography::get_type(),
            [
                'label' => __( 'Highlight Post Title', 'widgetkit-pro' ),
                'name' => 'highlight_post_title_typography',
                'selector' => '{{WRAPPER}} .featured-post .highlight-post-title h3',
            ]
        );
        $this->add_control(
            'regular_title',
            [
                'label' => __( 'Regular Post Title', 'widgetkit-pro' ),
                'type' => Controls_Manager::HEADING,
                'separator' => 'before',
            ]
        );
        $this->add_group_control(
            Group_Control_Typography::get_type(),
            [
                'label' => __( 'Regular Post Title', 'widgetkit-pro' ),
                'name' => 'regular_post_title_typography',
                'selector' => '{{WRAPPER}} .regular-post .regular-post-title h3',
            ]
        );
        $this->end_controls_section();


        $this->start_controls_section(
            'content_style',
            [
                'label' => __( 'Content', 'widgetkit-pro' ),
                'tab' => Controls_Manager::TAB_STYLE,
            ]
        );
        $this->add_control(
            'content_no_thumb_padding',
            [
                'label' => __( 'Content Padding', 'widgetkit-pro' ),
                'description' => __('Only works when regular post thumbnail is switched off', 'widgetkit-pro'),
                'type' => Controls_Manager::DIMENSIONS,
                'size_units' => [ 'px', '%', 'em' ],
                'selectors' => [
                    '{{WRAPPER}} .regular-post .post-data' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                ],
            ]
        );
        $this->add_control(
            'custom_color',
            [
                'label' => __( 'Custom Color', 'widgetkit-pro' ),
                'type' => Controls_Manager::SWITCHER,
                'default' => '',
                'description' => 'Show custom color for content',
                'label_on' => __( 'Yes', 'widgetkit-pro' ),
                'label_off' => __( 'No', 'widgetkit-pro' ),
                'return_value' => 'yes',
            ]
        );
        $this->add_control(
            'section_title_and_seperator_color',
            [
                'label' => __( 'Section Title & Seperator Color', 'widgetkit-pro' ),
                'type' => Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .layout-header .layout-title h4' => 'color: {{VALUE}}',
                    '{{WRAPPER}} .cat-post-list:before' => 'background: {{VALUE}} !important',
                ],
                'condition' => [
                    'custom_color' => 'yes',
                ],
            ]
        );
        $this->add_control(
            'carousel_bg_color',
            [
                'label' => __( 'Carousel Background Color', 'widgetkit-pro' ),
                'type' => Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .dynamic-single-category nav li' => 'background-color: {{VALUE}}',
                ],
                'condition' => [
                    'custom_color' => 'yes',
                ],
            ]
        );
        $this->add_control(
            'carousel_icon_color',
            [
                'label' => __( 'Carousel Icon Color', 'widgetkit-pro' ),
                'type' => Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .dynamic-single-category nav li' => 'color: {{VALUE}}',
                ],
                'condition' => [
                    'custom_color' => 'yes',
                ],
            ]
        );
        $this->add_control(
            'carousel_hover_bg_color',
            [
                'label' => __( 'Carousel Hover Background Color', 'widgetkit-pro' ),
                'type' => Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .dynamic-single-category nav li:hover' => 'background-color: {{VALUE}}',
                ],
                'condition' => [
                    'custom_color' => 'yes',
                ],
            ]
        );
        $this->add_control(
            'carousel_hover_icon_color',
            [
                'label' => __( 'Carousel Hover Icon Color', 'widgetkit-pro' ),
                'type' => Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .dynamic-single-category nav li:hover' => 'color: {{VALUE}}',
                ],
                'condition' => [
                    'custom_color' => 'yes',
                ],
            ]
        );
        $this->add_control(
            'carousel_disable_bg_color',
            [
                'label' => __( 'Carousel Disable Background Color', 'widgetkit-pro' ),
                'type' => Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .dynamic-single-category .first-page .single-cateogry-prev' => 'background-color: {{VALUE}}',
                    '{{WRAPPER}} .dynamic-single-category .last-page .single-cateogry-next' => 'background-color: {{VALUE}}',
                ],
                'condition' => [
                    'custom_color' => 'yes',
                ],
            ]
        );
        $this->add_control(
            'carousel_disable_icon_color',
            [
                'label' => __( 'Carousel Disable Icon Color', 'widgetkit-pro' ),
                'type' => Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .dynamic-single-category .first-page .single-cateogry-prev' => 'color: {{VALUE}}',
                    '{{WRAPPER}} .dynamic-single-category .last-page .single-cateogry-next' => 'color: {{VALUE}}',
                ],
                'condition' => [
                    'custom_color' => 'yes',
                ],
            ]
        );
        $this->add_control(
            'highlight_title_color',
            [
                'label' => __( 'Highlight Title Color', 'widgetkit-pro' ),
                'type' => Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .featured-post .highlight-post-title h3' => 'color: {{VALUE}}',
                ],
                'condition' => [
                    'custom_color' => 'yes',
                ],
            ]
        );
        $this->add_control(
            'highlight_title_hover_color',
            [
                'label' => __( 'Highlight Title Hover Color', 'widgetkit-pro' ),
                'type' => Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} a.highlight-post-title:hover h3' => 'color: {{VALUE}} !important',
                ],
                'condition' => [
                    'custom_color' => 'yes',
                ],
            ]
        );
        $this->add_control(
            'title_color',
            [
                'label' => __( 'Title Color', 'widgetkit-pro' ),
                'type' => Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .regular-post-title h3' => 'color: {{VALUE}}',
                ],
                'condition' => [
                    'custom_color' => 'yes',
                ],
            ]
        );
        $this->add_control(
            'title_hover_color',
            [
                'label' => __( 'Title Hover Color', 'widgetkit-pro' ),
                'type' => Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} a.regular-title:hover h3' => 'color: {{VALUE}} !important',
                ],
                'condition' => [
                    'custom_color' => 'yes',
                ],
            ]
        );
        $this->add_control(
            'highlight_meta_color',
            [
                'label' => __( 'Highlight Meta Color', 'widgetkit-pro' ),
                'type' => Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .featured-post .post-meta div' => 'color: {{VALUE}}',
                    '{{WRAPPER}} .featured-post .post-cat, {{WRAPPER}} .featured-post .post-cat a' => 'color: {{VALUE}}',
                ],
                'condition' => [
                    'custom_color' => 'yes',
                ],
            ]
        );
        $this->add_control(
            'meta_color',
            [
                'label' => __( 'Meta Color', 'widgetkit-pro' ),
                'type' => Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .regular-post .post-meta div' => 'color: {{VALUE}}',
                ],
                'condition' => [
                    'custom_color' => 'yes',
                ],
            ]
        );
        $this->add_control(
            'content_color',
            [
                'label' => __( 'Content Color', 'widgetkit-pro' ),
                'type' => Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .cat-post-list .post-excerpt' => 'color: {{VALUE}}',
                ],
                'condition' => [
                    'custom_color' => 'yes',
                ],
            ]
        );
        $this->add_control(
            'ajax_overlay_color',
            [
                'label' => __( 'Ajax Overlay Color', 'widgetkit-pro' ),
                'type' => Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .dynamic-layout .dynamic-cat-post-list .ajax-content' => 'background: {{VALUE}} !important',
                ],
                'condition' => [
                    'custom_color' => 'yes',
                ],
            ]
        );
        $this->add_control(
            'ajax_overlay_dot_color',
            [
                'label' => __( 'Ajax Overlay Dot Color', 'widgetkit-pro' ),
                'type' => Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .dynamic-layout .ajax-content .lds-ellipsis div' => 'background: {{VALUE}}',
                ],
                'condition' => [
                    'custom_color' => 'yes',
                ],
            ]
        );
        $this->add_control(
            'navigation_hover_color',
            [
                'label' => __( 'Navigation Hover Color', 'widgetkit-pro' ),
                'type' => Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .dynamic-single-category nav li:hover' => 'background: {{VALUE}} !important',
                ],
                'condition' => [
                    'custom_color' => 'yes',
                ],
            ]
        );
        $this->end_controls_section();

        $this->start_controls_section(
            'section_gradient',
            [
                'label' => __( 'Gradient', 'widgetkit-pro' ),
                'tab' => Controls_Manager::TAB_STYLE,
                'condition' => [
                    'layout_style' => ['single-category-dynamic-carousel-layout-1', 'single-category-dynamic-carousel-layout-2'],
                ],
            ]
        );
        $this->add_control(
            'overlay_style',
            [
                'label'       => __( 'Overlay Style', 'widgetkit-pro' ),
                'type' => Controls_Manager::SELECT,
                'default' => 'bg-overlay',
                'options' => [
                    'bg-overlay'  => __( 'Overlay', 'widgetkit-pro' ),
                    'bg-gradient'  => __( 'Gradient', 'widgetkit-pro' ),
                ],
            ]
        );
        $this->add_control(
            'background_overlay',
            [
                'label' => __( 'Background Overlay', 'widgetkit-pro' ),
                'type' => Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .single-category-dynamic-carousel-layout-1 .featured-post .post-thumb a:after' => 'background-color: {{VALUE}}',
                    '{{WRAPPER}} .single-category-dynamic-carousel-layout-2 .featured-post .post-thumb a:after' => 'background-color: {{VALUE}}',
                ],
                'condition' => [
                    'overlay_style' => 'bg-overlay',
                ],
            ]
        );

        $this->add_control(
            'gradient_1',
            [
                'label' => __( 'Gradient', 'widgetkit-pro' ),
                'type' => Controls_Manager::COLOR,
                'selectors' => [
                    '{{WRAPPER}} .single-category-dynamic-carousel-layout-1 .featured-post .post-thumb a:after' => 'background: linear-gradient(180deg, rgba(0, 0, 0, 0.01) 40%, {{VALUE}} 90%)',
                    '{{WRAPPER}} .single-category-dynamic-carousel-layout-1 .featured-post:hover .post-thumb a:after' => 'background-color: {{VALUE}}',
                    '{{WRAPPER}} .single-category-dynamic-carousel-layout-2 .featured-post .post-thumb a:after' => 'background: linear-gradient(180deg, rgba(0, 0, 0, 0.01) 40%, {{VALUE}} 90%)',
                    '{{WRAPPER}} .single-category-dynamic-carousel-layout-2 .featured-post:hover .post-thumb a:after' => 'background-color: {{VALUE}}',
                ],
                'condition' => [
                    'overlay_style' => 'bg-gradient',
                ],
            ]
        );
        $this->add_control(
            'highlight_tiles_text_shadow',
            [
                'label' => __( 'Tiles Title Text Shadow', 'widgetkit-pro' ),
                'type' => Controls_Manager::TEXT_SHADOW,
                'selectors' => [
                    '{{WRAPPER}} .single-category-dynamic-carousel-layout-2.tiles .featured-post .post-title h3' => 'text-shadow: {{HORIZONTAL}}px {{VERTICAL}}px {{BLUR}}px {{COLOR}};',
                ],
                'condition' => [
                    'overlay_style' => 'bg-gradient',
                ],
            ]
        );

        $this->end_controls_section();

    }


    protected function render()
    {
        $settings = $this->get_settings();
        $layout = widgetkit_pro_array_get($settings, 'layout_style');
        $layout_header_enable = widgetkit_pro_array_get($settings, 'single_layout_header_enable');
        $layout_title = widgetkit_pro_array_get($settings, 'single_layout_title');

        $cat_id = widgetkit_pro_array_get($settings, 'cat_single_id');
        $featured_thumbnail_size = widgetkit_pro_array_get($settings, 'featured_thumbnail_size');
        $featured_thumbnail_style = widgetkit_pro_array_get($settings, 'featured_thumbnail_style');
        $show_regular_thumbnail = widgetkit_pro_array_get($settings, 'show_regular_thumbnail');
        $regular_thumbnail_size = widgetkit_pro_array_get($settings, 'regular_thumbnail_size');

        $post_num_to_show = widgetkit_pro_array_get($settings, 'post_num_to_show');
        $highlight_first_post = widgetkit_pro_array_get($settings, 'highlight_first_post');
        $show_highlight_cat_tag = widgetkit_pro_array_get($settings, 'show_highlight_cat_tag');
        $show_cat_tag = widgetkit_pro_array_get($settings, 'show_cat_tag');
        $tax_term = get_term_meta($cat_id);
        // $tax_tag_bg_color = widgetkit_pro_array_get($tax_term, 'magmax_tax_tag_bg_color')[0];
        $regular_post_grid = widgetkit_pro_array_get($settings, 'regular_post_grid');
        $regular_post_style = widgetkit_pro_array_get($settings, 'regular_post_style');
        $title_word = widgetkit_pro_array_get($settings, 'title_word');



        if('single-category-dynamic-carousel-layout-2' == $layout):
            $layout_class = $layout.' '.$featured_thumbnail_style;
        endif;


        ?>

        <div id="dynamic-single-category-<?php echo $cat_id; ?>" class="dynamic-single-category <?php echo $layout .' '. $featured_thumbnail_style; ?> dynamic-<?php echo $cat_id; ?>">
            <?php include( plugin_dir_path( __FILE__ ) . '../layout/dynamic-carousel/'. $layout .'.php'); ?>
        </div>
    <?php
    }
    protected function _content_template()
    {
    }
}
