Your IP : 216.73.216.0


Current Path : /home/goldnueh/netsetsolution.com/wp-content/plugins/zeinet-addon/includes/Widgets/
Upload File :
Current File : /home/goldnueh/netsetsolution.com/wp-content/plugins/zeinet-addon/includes/Widgets/Blog.php

<?php

namespace Layerdrops\Zeinet\Widgets;


class Blog extends \Elementor\Widget_Base
{
    public function get_name()
    {
        return 'zeinet-blog';
    }

    public function get_title()
    {
        return __('Blog', 'zeinet-addon');
    }

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

    public function get_categories()
    {
        return ['zeinet-category'];
    }

    protected function register_controls()
    {
        $this->start_controls_section(
            'layout_section',
            [
                'label' => __('Layout', 'zeinet-addon'),
                'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
            ]
        );

        $this->add_control(
            'layout_type',
            [
                'label' => __('Select Layout', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::SELECT2,
                'default' => 'layout_one',
                'options' => [
                    'layout_one' => __('Layout One', 'zeinet-addon'),
                    'layout_two' => __('Layout Two', 'zeinet-addon'),
                    'layout_three' => __('Layout Three', 'zeinet-addon'),
                    'layout_four' => __('Layout Four', 'zeinet-addon'),
                ]
            ]
        );



        $this->add_control(
            'pagination_status',
            [
                'label' => __('Enable Pagination?', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::SWITCHER,
                'label_on' => __('Yes', 'zeinet-addon'),
                'label_off' => __('No', 'zeinet-addon'),
                'return_value' => 'yes',
                'default' => 'no',
                'condition' => [
                    'layout_type!' =>  'layout_four'
                ]
            ]
        );


        $this->add_control(
            'sec_title',
            [
                'label' => __('Title', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::TEXTAREA,
                'placeholder' => __('Add Title', 'zeinet-addon'),
                'default' => __('Default Title', 'zeinet-addon'),
                'condition' => [
                    'layout_type' => ['layout_one', 'layout_two']
                ]
            ]
        );

        $this->add_control(
            'sec_sub_title',
            [
                'label' => __('Sub Title', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::TEXTAREA,
                'placeholder' => __('Add Sub Title', 'zeinet-addon'),
                'default' => __('Default Sub Title', 'zeinet-addon'),
                'condition' => [
                    'layout_type' => ['layout_one', 'layout_two']
                ]
            ]
        );

        $this->end_controls_section();

        $this->start_controls_section(
            'content_section',
            [
                'label' => __('Post Options', 'zeinet-addon'),
                'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
            ]
        );


        $this->add_control(
            'post_count',
            [
                'label' => __('Number Of Posts', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::SLIDER,
                'size_units' => ['count'],
                'range' => [
                    'count' => [
                        'min' => 0,
                        'max' => 15,
                        'step' => 1,
                    ],
                ],
                'default' => [
                    'unit' => 'count',
                    'size' => 6,
                ],
            ]
        );

        $this->add_control(
            'select_category',
            [
                'label' => __('Post Category', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::SELECT2,
                'options' => zeinet_get_taxonoy('category'),
            ]
        );

        $this->add_control(
            'query_order',
            [
                'label' => __('Select Order', 'zeinet-addon'),
                'type' => \Elementor\Controls_Manager::SELECT2,
                'default' => 'DESC',
                'options' => [
                    'DESC' => __('DESC', 'zeinet-addon'),
                    'ASC' => __('ASC', 'zeinet-addon'),
                ]
            ]
        );

        $this->end_controls_section();


        //General style
        $this->start_controls_section(
            'general_style',
            [
                'label' => esc_html__('Style Options', 'zeinet-addon'),
                'tab' => \Elementor\Controls_Manager::TAB_STYLE,
            ]
        );

        zeinet_typo_and_color_options($this, 'Section Title', '{{WRAPPER}} .section-title__title', ['layout_one', 'layout_two']);
        zeinet_typo_and_color_options($this, 'Section Sub Title', '{{WRAPPER}} .section-title__tagline', ['layout_one', 'layout_two']);

        zeinet_typo_and_color_options($this, 'Title', '{{WRAPPER}} .news-one__title a', ['layout_one', 'layout_two', 'layout_three', 'layout_four']);
        zeinet_typo_and_color_options($this, 'Meta', '{{WRAPPER}} .news-one__meta li a, {{WRAPPER}} .news-one__meta li span', ['layout_one', 'layout_two', 'layout_three', 'layout_four']);
        zeinet_typo_and_color_options($this, 'Read More', '{{WRAPPER}} .news-one__read-more', ['layout_one', 'layout_two', 'layout_three', 'layout_four']);

        $this->end_controls_section();

        zeinet_get_elementor_carousel_options($this, ['layout_four']);
    }

    protected function render()
    {
        $settings = $this->get_settings_for_display();
        include zeinet_get_template('blog-one.php');
        include zeinet_get_template('blog-two.php');
        include zeinet_get_template('blog-three.php');
        include zeinet_get_template('blog-four.php');
    }
}