File "features-20241225025113.php"

Full Path: /home/flipjqml/onlinebetsolution.com/wp-content/plugins/cyarb-toolkit/widgets/features-20241225025113.php
File size: 40.65 KB
MIME-type: text/x-php
Charset: utf-8

<?php
/**
 * Features Area Widget
 */

namespace Elementor;

// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

class Cyarb_Features_Area extends Widget_Base {

	public function get_name() {
        return 'FeaturesArea';
    }

	public function get_title() {
        return esc_html__( 'Features Area', 'cyarb-toolkit' );
    }

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

	public function get_categories() {
        return [ 'cyarb-elements' ];
    }

	protected function register_controls() {

        $this->start_controls_section(
			'Cyarb_Features_Area_controls',
			[
				'label' => esc_html__( 'Features Area Controls', 'cyarb-toolkit' ),
				'tab' => Controls_Manager::TAB_CONTENT,
			]
        );

            $this->add_control(
                'service_style',
                [
                    'label' => __( 'Service Style', 'cyarb-toolkit' ),
                    'type' => Controls_Manager::SELECT,
                    'options' => [
                        '1'         => __( 'Style One', 'cyarb-toolkit' ),
                        '2'         => __( 'Style Two', 'cyarb-toolkit' ),
                        '3'         => __( 'Style Three', 'cyarb-toolkit' ),
                        '4'         => __( 'Style Four', 'cyarb-toolkit' ),
                        '5'         => __( 'Style Five', 'cyarb-toolkit' ),
                    ],
                    'default' => '1',
                ]
            );

            $this->add_control(
                'sec_image',
                [
                    'label'     => esc_html__( 'Background Image', 'cyarb-toolkit' ),
                    'type'	    => Controls_Manager::MEDIA,
                    'condition' => [
                        'service_style' => '5',
                    ]
                ]
            );

            $this->add_control(
                'section_show',
                [
                    'label' => __( 'Section Show?', 'cyrab-toolkit' ),
                    'type' => Controls_Manager::SWITCHER,
                    'label_on' => __( 'Show', 'cyrab-toolkit' ),
                    'label_off' => __( 'Hide', 'cyrab-toolkit' ),
                    'return_value' => 'yes',
                    'default' => 'yes',
                    'condition' => [
                        'service_style' => ['2','4','3','5'],
                    ]
                ]
            );

            $this->add_control(
                'title',
                [
                    'label' => esc_html__( 'Title', 'cyarb-toolkit' ),
                    'type' => Controls_Manager::TEXT,
                    'condition' => [
                        'service_style' => ['2','4','3','5'],
                        'section_show' => 'yes',
                    ]
                ]
            );

            $this->add_control(
                'title_tag',
                [
                    'label' => esc_html__( 'Title Tag', 'cyarb-toolkit' ),
                    'type' => Controls_Manager::SELECT,
                    'options' => [
                        'h1'         => esc_html__( 'h1', 'cyarb-toolkit' ),
                        'h2'         => esc_html__( 'h2', 'cyarb-toolkit' ),
                        'h3'         => esc_html__( 'h3', 'cyarb-toolkit' ),
                        'h4'         => esc_html__( 'h4', 'cyarb-toolkit' ),
                        'h5'         => esc_html__( 'h5', 'cyarb-toolkit' ),
                        'h6'         => esc_html__( 'h6', 'cyarb-toolkit' ),
                    ],
                    'default' => 'h2',
                    'condition' => [
                        'service_style' => ['2','4','3','5'],
                        'section_show' => 'yes',
                    ]
                ]
            );

            $this->add_control(
                'desc',
                [
                    'label'=>__('Add Description', 'cyarb-toolkit'),
                    'type'=>Controls_Manager:: WYSIWYG,
                    'description' => __('This text editor for p','cyarb-toolkit'),
                    'condition' => [
                        'service_style' => ['2','4','3','5'],
                        'section_show' => 'yes',
                    ]
                ]
            );

            $this->add_control(
                'count',
                [
                    'label' => __( 'Post Per Page', 'cyarb-toolkit' ),
                    'default' => __( '3', 'cyarb-toolkit' ),
                    'type' => Controls_Manager::TEXT,
                    'description' => __('if you want to see all post type -1','cyarb-toolkit')
                ]
            );
            $this->add_control(
                'cat_name',
                [
                    'label' => __( 'Select Category', 'cyarb-toolkit' ),
                    'type' => Controls_Manager::SELECT,
                    'options' => cyarb_toolkit_get_product_cat_list(),
                ]
            );
            $this->add_control(
                'order',
                [
                    'label' => __( 'Select Order', 'cyarb-toolkit' ),
                    'type' => Controls_Manager::SELECT,
                    'options' => [
                        'DESC'  => __( 'DESC', 'cyarb-toolkit' ),
                        'ASC'  => __( 'ASC', 'cyarb-toolkit' ),
                    ],
                    'default' => 'DESC',
                ]
            );
            $this->add_control(
                'excerpt_num',
                [
                    'label'   => __( 'Excerpt', 'cyarb-toolkit' ),
                    'type'    => Controls_Manager::NUMBER,
                    'default' => 25,
                ]
            );

            //Read More Button Hide/Show
            $this->add_control(
                'read_button_show',
                [
                    'label' => esc_html__( 'Hide Read More Button?', 'cyarb-toolkit' ),
                    'type' => Controls_Manager::SWITCHER,
                    'label_on' => esc_html__( 'Show', 'cyarb-toolkit' ),
                    'label_off' => esc_html__( 'Hide', 'cyarb-toolkit' ),
                    'return_value' => 'yes',
                    'default' => 'yes',
                    'condition' => [
                        'service_style' => ['2','3','5'],
                    ]
                ]
            );

            $this->add_control(
                'read_more_btntext',
                [
                    'label'     => __( 'Read More Button Text', 'cyarb-toolkit' ),
                    'default'   => __( 'Read More', 'cyarb-toolkit' ),
                    'type'      => Controls_Manager::TEXT,
                    'condition' => [
                        'read_button_show' => 'yes',
                    ]
                ]
            );

            $this->add_control(
                'button_show',
                [
                    'label'        => esc_html__( 'Hide Button?', 'cyarb-toolkit' ),
                    'type'         => Controls_Manager::SWITCHER,
                    'label_on'     => esc_html__( 'Show', 'cyarb-toolkit' ),
                    'label_off'    => esc_html__( 'Hide', 'cyarb-toolkit' ),
                    'return_value' => 'yes',
                    'default'      => 'yes',
                    'condition' => [
                        'service_style' => ['2','3','5'],
                    ]
                ]
            );

            $this->add_control(
                'button_text',
                [
                    'label'   => __( 'Button Text', 'cyarb-toolkit' ),
                    'type'    => Controls_Manager::TEXT,
                    'default' => __('View More Services', 'cyarb-toolkit'),
                    'condition' => [
                        'service_style' => ['2','3','5'],
                        'button_show'   => 'yes',
                    ]
                ]
            );
    
            $this->add_control(
                'link_type',
                [
                    'label'       => __( 'Link Type', 'cyarb-toolkit' ),
                    'type'        => Controls_Manager::SELECT,
                    'label_block' => true,
                    'options'     => [
                        '1'  => __( 'Link To Page', 'cyarb-toolkit' ),
                        '2'  => __( 'External Link', 'cyarb-toolkit' ),
                    ], 
                    'condition' => [
                        'service_style' => ['2','3','5'],
                        'button_show'   => 'yes',
                    ]
                ]
            );
    
            $this->add_control(
                'link_to_page',
                [
                    'label'       => __( 'Link Page', 'cyarb-toolkit' ),
                    'type'        => Controls_Manager::SELECT,
                    'label_block' => true,
                    'options'     => cyarb_toolkit_get_page_as_list(),
                    'condition'   => [
                        'link_type'     => '1',
                        'service_style' => ['2','3','5'],
                        'button_show'   => 'yes',
                    ]
                ]
            );
    
            $this->add_control(
                'external_link',
                [
                    'label'     =>__('External Link', 'cyarb-toolkit'),
                    'type'      => Controls_Manager:: TEXT,
                    'condition' => [
                        'link_type'     => '2',
                        'service_style' => ['2','3','5'],
                        'button_show'   => 'yes',
                    ]
                ]
            );
    
            //Target Page
            $this->add_control(
                'target_page',
                [
                    'label'        => __( 'Link Open In New Tab?', 'cyarb-toolkit' ),
                    'type'         => Controls_Manager::SWITCHER,
                    'label_on'     => __( 'Yes', 'cyarb-toolkit' ),
                    'label_off'    => __( 'No', 'cyarb-toolkit' ),
                    'return_value' => 'yes',
                    'default'      => 'yes',
                    'condition' => [
                        'service_style' => ['2','3','5'],
                        'button_show'   => 'yes',
                    ]
                ]
            );
            
            //Shape Images
            $this->add_control(
                'image_shape',
                [
                    'label'        => esc_html__( 'Hide Shapes?', 'cyarb-toolkit' ),
                    'type'         => Controls_Manager::SWITCHER,
                    'label_on'     => esc_html__( 'Show', 'cyarb-toolkit' ),
                    'label_off'    => esc_html__( 'Hide', 'cyarb-toolkit' ),
                    'return_value' => 'yes',
                    'default'      => 'yes',
                    'condition' => [
                        'service_style' => ['2','3','4','5'],
                    ]
                ]
            );

            $this->add_control(
                'shape1',
                [
                    'label'     => esc_html__( 'Shape1', 'cyarb-toolkit' ),
                    'type'	    => Controls_Manager::MEDIA,
                    'condition' => [
                        'service_style' => ['2','3','4','5'],
                    ]
                ]
            );
            $this->add_control(
                'shape2',
                [
                    'label'     => esc_html__( 'Shape2', 'cyarb-toolkit' ),
                    'type'	    => Controls_Manager::MEDIA,
                    'condition' => [
                        'service_style' => ['2','3','4','5'],
                    ]
                ]
            );
            $this->add_control(
                'shape3',
                [
                    'label'     => esc_html__( 'Shape3', 'cyarb-toolkit' ),
                    'type'	    => Controls_Manager::MEDIA,
                    'condition' => [
                        'service_style' => ['2','3','4','5'],
                    ]
                ]
            );
            $this->add_control(
                'shape4',
                [
                    'label'     => esc_html__( 'Shape4', 'cyarb-toolkit' ),
                    'type'	    => Controls_Manager::MEDIA,
                    'condition' => [
                        'service_style' => '2',
                    ]
                ]
            );

            $this->add_control(
                'pagination_area',
                [
                    'label'    => __( 'Hide Pagination?', 'cyarb-toolkit' ),
                    'type'     => Controls_Manager::SWITCHER,
                    'label_on' => __( 'Show', 'cyarb-toolkit' ),
                    'label_off'    => __( 'Hide', 'cyarb-toolkit' ),
                    'return_value' => 'yes',
                    'default'   => 'yes',
                    'condition' => [
                        'service_style' => ['2','3'],
                        'image_shape'   => 'yes',
                    ]
                ]
            );

        $this->end_controls_section();

        $this->start_controls_section(
			'style',
			[
				'label' => esc_html__( 'Style', 'cyarb-toolkit' ),
				'tab' => Controls_Manager::TAB_STYLE,
			]
		);	

            $this->add_control(
                'section_bg_color',
                [
                    'label' => esc_html__( 'Section Background Color', 'hixo-toolkit' ),
                    'type' => Controls_Manager::COLOR,
                    'selectors' => [
                        '{{WRAPPER}} .bg-f5f8ff' => 'background-color: {{VALUE}}',
                    ],
                    'condition' => [
                        'service_style!' => ['1','5'],
                    ]
                ]
            );

            $this->add_control(
                'sec_title_color',
                [
                    'label' => esc_html__( 'Section Title Color', 'cyarb-toolkit' ),
                    'type' => Controls_Manager::COLOR,
                    'selectors' => [
                        '{{WRAPPER}} .section-title h2, .section-title h3, .section-title h4, .section-title h5, .section-title h5, .section-title h6, .section-title h1' => 'color: {{VALUE}}',
                    ],
                    'condition' => [
                        'service_style' => ['2','4','5'],
                        'section_show' => 'yes',
                    ]
                ]
            );

            $this->add_group_control(
                Group_Control_Typography::get_type(),
                [
                    'name' => 'sec_title_typography',
                    'label' => __( 'Section Title Typography', 'cyarb-toolkit' ),
                    'selector' => '{{WRAPPER}} .section-title h2, .section-title h3, .section-title h4, .section-title h5, .section-title h5, .section-title h6, .section-title h1',
                    'condition' => [
                        'service_style' => ['2','4','5'],
                        'section_show' => 'yes',
                    ]
                ]
            );

            $this->add_control(
                'title_color',
                [
                    'label' => esc_html__( 'Title Color', 'cyarb-toolkit' ),
                    'type' => Controls_Manager::COLOR,
                    'selectors' => [
                        '{{WRAPPER}} .single-features-box h3 a, .single-services-box h3 a, .services-box h3 a' => 'color: {{VALUE}}',
                    ],
                ]
            );

            $this->add_group_control(
                Group_Control_Typography::get_type(),
                [
                    'name' => 'title_typography',
                    'label' => esc_html__( 'Title Typography', 'cyarb-toolkit' ),
                    'selector' => '{{WRAPPER}} .single-features-box h3, .single-services-box h3, .services-box h3',
                ]
            );

            $this->add_control(
                'desc_color',
                [
                    'label' => esc_html__( 'Description Color', 'cyarb-toolkit' ),
                    'type' => Controls_Manager::COLOR,
                    'selectors' => [
                        '{{WRAPPER}} p' => 'color: {{VALUE}}',
                    ],
                ]
            );

            $this->add_group_control(
                Group_Control_Typography::get_type(),
                [
                    'name' => 'desc_typography',
                    'label' => esc_html__( 'Description Typography', 'cyarb-toolkit' ),
                    'selector' => '{{WRAPPER}} p',
                ]
            );

            $this->add_control(
                'btn_color',
                [
                    'label' => esc_html__( 'Button Color', 'cyarb-toolkit' ),
                    'type' => Controls_Manager::COLOR,
                    'selectors' => [
                        '{{WRAPPER}} .default-btn, .single-services-box .link-btn, .services-box .link-btn, .services-box .content .link-btn' => 'color: {{VALUE}}',
                        'condition' => [
                            'service_style' => ['2','3','5'],
                        ]
                    ],
                ]
            );

            $this->add_group_control(
                Group_Control_Typography::get_type(),
                [
                    'name' => 'btn_typography',
                    'label' => esc_html__( 'Button Typography', 'cyarb-toolkit' ),
                    'selector' => '{{WRAPPER}} .single-services-box .link-btn, .services-box .link-btn, .services-box .content .link-btn',
                    'condition' => [
                        'service_style' => ['2','3','5'],
                    ]
                ]
            );

        $this->end_controls_section();

    }

	protected function render() {

		$settings = $this->get_settings_for_display();

        $section_show = $settings['section_show'];

        if( $settings['cat_name'] != '' ) {
            $args = array(
                'post_type' => 'service',
                'posts_per_page' => $settings['count'],
                'order' => $settings['order'],
                'paged' => get_query_var('paged') ? get_query_var('paged') : 1,
                'tax_query' => array(
                    array(
                        'taxonomy' => 'service_cat',
                        'field' => 'slug',
                        'terms' => $settings['cat_name'],
                        'hide_empty' => false
                    )
                )
            );
        } else {
            $args = array(
                'post_type' => 'service',
                'posts_per_page' => $settings['count'],
                'order' => $settings['order'],
                'paged' => get_query_var('paged') ? get_query_var('paged') : 1
            );
        }
        $services_array = new \WP_Query( $args ); 

        $btn1_text  = $settings['button_text'];
        //  Button Link
        $link_source = '';

        if( $settings['link_type'] == 1 ){
            $link_source = get_page_link($settings['link_to_page']); 
        } else {
            $link_source = $settings['external_link'];
        }
        
        ?>

        <?php if( $settings['service_style'] == '1' ): ?>
            <div class="features-area pt-100 pb-75">
                <div class="container">
                    <div class="row justify-content-center">
                        <?php while($services_array->have_posts()): $services_array->the_post();
                            // ACF field access
                            if (class_exists( 'ACF') && get_field('service_icon_image')){
                                $icon_img      = get_field('service_icon_image');
                            } else {
                                $icon_img      = '';
                            } 
                            $id = get_the_ID();
                        ?>
                            <div class="col-lg-4 col-md-6">
                                <div class="single-features-box style-two">
                                    <?php if( $icon_img != '') : ?>
                                        <div class="icon">
                                            <img src="<?php echo esc_url($icon_img); ?>" alt="<?php echo esc_attr__('services-icon','cyarb-toolkit'); ?>">
                                        </div>
                                    <?php endif; ?>
                                    <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
                        
                                    <p><?php echo esc_html(wp_trim_words( get_the_excerpt(), $settings['excerpt_num'], '' )); ?></p>
                                </div>
                            </div>
                        <?php endwhile; wp_reset_query(); ?>
                    </div>
                </div>
            </div>
        <?php elseif( $settings['service_style'] == '2' ): ?>
            <div class="services-area ptb-100 bg-f5f8ff">
                <div class="container">
                    <?php if ( 'yes' === $section_show ) : ?>
                        <div class="section-title">
                            <<?php echo esc_attr($settings['title_tag']);?>><?php echo esc_html( $settings['title'] ); ?></<?php echo esc_attr($settings['title_tag']);?>>
                            <?php echo wp_kses_post( $settings['desc'] ); ?>
                        </div>
                    <?php endif; ?>
                    <div class="row">

                        <?php while($services_array->have_posts()): $services_array->the_post();
                            
                            // ACF field access
                            if (class_exists( 'ACF') && get_field('service_icon_image')){
                                $icon_img      = get_field('service_icon_image');
                            } else {
                                $icon_img      = '';
                            } 

                            $id = get_the_ID();

                        ?>
                            <div class="col-lg-4 col-md-6">
                                <div class="services-box">
                                    <?php if ( get_the_post_thumbnail_url() ){ ?>
                                        <div class="image">
                                            <img src="<?php echo esc_url( get_the_post_thumbnail_url() ); ?>" alt="<?php echo esc_attr__('services-img','cyarb-toolkit'); ?>">
                                        </div>
                                    <?php } ?>
                                    <div class="content">
                                        <?php if( $icon_img != '') : ?>
                                            <div class="icon">
                                                <img src="<?php echo esc_url($icon_img); ?>" alt="<?php echo esc_attr__('services-icon','cyarb-toolkit'); ?>">
                                            </div>
                                        <?php endif; ?>

                                        <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>

                                        <p><?php echo esc_html(wp_trim_words( get_the_excerpt(), $settings['excerpt_num'], '' )); ?></p>

                                        <?php if ( 'yes' === $settings['read_button_show'] ) : ?>
                                            <a href="<?php the_permalink(); ?>" class="link-btn"><?php echo esc_html( $settings['read_more_btntext'] ); ?> <i class="lni lni-chevron-right"></i></a>
                                        <?php endif; ?>
                                    </div>
                                </div>
                            </div>
                        <?php endwhile; wp_reset_query(); ?>

                        <?php if ( 'yes' === $settings['button_show'] ) : ?>
                            <?php if($btn1_text != '' ) { ?>
                                <div class="col-lg-12 col-md-12">
                                    <div class="view-more-box">
                                        <?php if ( 'yes' === $settings['target_page'] ) { ?>
                                            <a target="_blank" href="<?php echo esc_url($link_source); ?>" class="default-btn">
                                                <span><?php echo esc_html($btn1_text); ?></span>
                                            </a>
                                        <?php } else { ?>
                                            <a href="<?php echo esc_url($link_source); ?>" class="default-btn">
                                                <span><?php echo esc_html($btn1_text); ?></span>
                                            </a>
                                        <?php } ?>
                                    </div>
                                </div><?php  
                            } ?>
                        <?php endif; ?>

                        <?php if ( 'yes' === $settings['pagination_area'] ) : ?>
                            <div class="col-lg-12 col-md-12">
                                <div class="pagination-area">
                                    <nav aria-label="navigation">
                                    <?php 
                                    $big = 999999999; // need an unlikely integer
                                    echo paginate_links( array(
                                        'base' => str_replace( $big, '%#%', get_pagenum_link( $big ) ),
                                        'format' => '?paged=%#%',
                                        'current' => max( 1, get_query_var('paged') ),
                                        'total' => $services_array->max_num_pages,
                                        //'format' => '?paged=%#%',
                                        'prev_text' => '<i class="lni lni-angle-double-left"></i>',
                                        'next_text' => '<i class="lni lni-angle-double-right"></i>',
                                    ) ); ?>  
                                    </nav>
                                </div>
                            </div>
                        <?php endif; ?>
                    </div>
                </div>

                <?php if ( 'yes' === $settings['image_shape'] ) : ?>
                    <?php if( $settings['shape1']['url'] != '' ) : ?>
                        <div class="shape1"> <img src="<?php echo esc_url( $settings['shape1']['url'] ); ?>" alt="<?php echo esc_attr__( 'Shape' ); ?>"></div>
                    <?php endif; ?>
                    <?php if( $settings['shape2']['url'] != '' ) : ?>
                        <div class="shape3"><img src="<?php echo esc_url( $settings['shape2']['url'] ); ?>" alt="<?php echo esc_attr__( 'Shape' ); ?>"></div>
                    <?php endif; ?>
                    <?php if( $settings['shape3']['url'] != '' ) : ?>
                        <div class="shape6"><img src="<?php echo esc_url( $settings['shape3']['url'] ); ?>" alt="<?php echo esc_attr__( 'Shape' ); ?>"></div>
                    <?php endif; ?>
                    <?php if( $settings['shape4']['url'] != '' ) : ?>
                        <div class="shape11"><img src="<?php echo esc_url( $settings['shape4']['url'] ); ?>" alt="<?php echo esc_attr__( 'Shape' ); ?>"></div>
                    <?php endif; ?>
                <?php endif; ?>
            </div>
        <?php elseif( $settings['service_style'] == '3' ): ?>
            <div class="services-area ptb-100 bg-f5f8ff">
                <div class="container">
                    <?php if ( 'yes' === $section_show ) : ?>
                        <div class="section-title">
                            <<?php echo esc_attr($settings['title_tag']);?>><?php echo esc_html( $settings['title'] ); ?></<?php echo esc_attr($settings['title_tag']);?>>
                            <?php echo wp_kses_post( $settings['desc'] ); ?>
                        </div>
                    <?php endif; ?>
                    <div class="row">
                        <?php while($services_array->have_posts()): $services_array->the_post();
                            
                            // ACF field access
                            if (class_exists( 'ACF') && get_field('service_icon_image')){
                                $icon_img      = get_field('service_icon_image');
                            } else {
                                $icon_img      = '';
                            } 

                            $id = get_the_ID();

                        ?>
                            <div class="col-lg-4 col-md-6">
                                <div class="single-services-box style-two">
                                    <?php if( $icon_img != '') : ?>
                                        <div class="icon">
                                            <img src="<?php echo esc_url($icon_img); ?>" alt="<?php echo esc_attr__('services-icon','cyarb-toolkit'); ?>">
                                        </div>
                                    <?php endif; ?>
                                    <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
                                    <p><?php echo esc_html(wp_trim_words( get_the_excerpt(), $settings['excerpt_num'], '' )); ?></p>
                                    <?php if ( 'yes' === $settings['read_button_show'] ) : ?>
                                        <a href="<?php the_permalink(); ?>" class="link-btn"><?php echo esc_html( $settings['read_more_btntext'] ); ?> <i class="lni lni-chevron-right"></i></a>
                                    <?php endif; ?>
                                </div>
                            </div>
                        <?php endwhile; wp_reset_query(); ?>

                        <?php if ( 'yes' === $settings['button_show'] ) : ?>
                            <?php if($btn1_text != '' ) { ?>
                                <div class="col-lg-12 col-md-12">
                                    <div class="view-more-box">
                                        <?php if ( 'yes' === $settings['target_page'] ) { ?>
                                            <a target="_blank" href="<?php echo esc_url($link_source); ?>" class="default-btn">
                                                <span><?php echo esc_html($btn1_text); ?></span>
                                            </a>
                                        <?php } else { ?>
                                            <a href="<?php echo esc_url($link_source); ?>" class="default-btn">
                                                <span><?php echo esc_html($btn1_text); ?></span>
                                            </a>
                                        <?php } ?>
                                    </div>
                                </div><?php  
                            } ?>
                        <?php endif; ?>

                        <?php if ( 'yes' === $settings['pagination_area'] ) : ?>
                            <div class="col-lg-12 col-md-12">
                                <div class="pagination-area">
                                    <nav aria-label="navigation">
                                    <?php 
                                    $big = 999999999; // need an unlikely integer
                                    echo paginate_links( array(
                                        'base' => str_replace( $big, '%#%', get_pagenum_link( $big ) ),
                                        'format' => '?paged=%#%',
                                        'current' => max( 1, get_query_var('paged') ),
                                        'total' => $services_array->max_num_pages,
                                        //'format' => '?paged=%#%',
                                        'prev_text' => '<i class="lni lni-angle-double-left"></i>',
                                        'next_text' => '<i class="lni lni-angle-double-right"></i>',
                                    ) ); ?>  
                                    </nav>
                                </div>
                            </div>
                        <?php endif; ?>
                    </div>
                </div>

                <?php if ( 'yes' === $settings['image_shape'] ) : ?>
                    <?php if( $settings['shape1']['url'] != '' ) : ?>
                        <div class="shape1"> <img src="<?php echo esc_url( $settings['shape1']['url'] ); ?>" alt="<?php echo esc_attr__( 'Shape' ); ?>"></div>
                    <?php endif; ?>
                    <?php if( $settings['shape2']['url'] != '' ) : ?>
                        <div class="shape3"><img src="<?php echo esc_url( $settings['shape2']['url'] ); ?>" alt="<?php echo esc_attr__( 'Shape' ); ?>"></div>
                    <?php endif; ?>
                    <?php if( $settings['shape3']['url'] != '' ) : ?>
                        <div class="shape6"><img src="<?php echo esc_url( $settings['shape3']['url'] ); ?>" alt="<?php echo esc_attr__( 'Shape' ); ?>"></div>
                    <?php endif; ?>
                <?php endif; ?>
            </div>
        <?php elseif( $settings['service_style'] == '4' ): ?>
            <div class="services-area pt-100 pb-75 bg-f5f8ff">
                <div class="container">
                    <?php if ( 'yes' === $section_show ) : ?>
                        <div class="section-title">
                            <<?php echo esc_attr($settings['title_tag']);?>><?php echo esc_html( $settings['title'] ); ?></<?php echo esc_attr($settings['title_tag']);?>>
                            <?php echo wp_kses_post( $settings['desc'] ); ?>
                        </div>
                    <?php endif; ?>
                    <div class="row">
                        <?php while($services_array->have_posts()): $services_array->the_post();
                            
                            // ACF field access
                            if (class_exists( 'ACF') && get_field('service_icon_image')){
                                $icon_img      = get_field('service_icon_image');
                            } else {
                                $icon_img      = '';
                            } 

                            $id = get_the_ID();

                        ?>
                            <div class="col-lg-4 col-md-6">
                                <div class="single-services-box style-two">
                                    <?php if( $icon_img != '') : ?>
                                        <div class="icon">
                                            <img src="<?php echo esc_url($icon_img); ?>" alt="<?php echo esc_attr__('services-icon','cyarb-toolkit'); ?>">
                                        </div>
                                    <?php endif; ?>
                                    <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
                                    <p><?php echo esc_html(wp_trim_words( get_the_excerpt(), $settings['excerpt_num'], '' )); ?></p>
                                </div>
                            </div>
                        <?php endwhile; wp_reset_query(); ?>
                        
                    </div>
                </div>

                <?php if ( 'yes' === $settings['image_shape'] ) : ?>
                    <?php if( $settings['shape1']['url'] != '' ) : ?>
                        <div class="shape1"> <img src="<?php echo esc_url( $settings['shape1']['url'] ); ?>" alt="<?php echo esc_attr__( 'Shape' ); ?>"></div>
                    <?php endif; ?>
                    <?php if( $settings['shape2']['url'] != '' ) : ?>
                        <div class="shape3"><img src="<?php echo esc_url( $settings['shape2']['url'] ); ?>" alt="<?php echo esc_attr__( 'Shape' ); ?>"></div>
                    <?php endif; ?>
                    <?php if( $settings['shape3']['url'] != '' ) : ?>
                        <div class="shape6"><img src="<?php echo esc_url( $settings['shape3']['url'] ); ?>" alt="<?php echo esc_attr__( 'Shape' ); ?>"></div>
                    <?php endif; ?>
                <?php endif; ?>

            </div>
        <?php else: ?>
            <div class="services-area ptb-100 bg-image" style="background-image:url(<?php echo esc_url( $settings['sec_image']['url'] ); ?>);">
                <div class="container">
                    <?php if ( 'yes' === $section_show ) : ?>
                        <div class="section-title">
                            <<?php echo esc_attr($settings['title_tag']);?>><?php echo esc_html( $settings['title'] ); ?></<?php echo esc_attr($settings['title_tag']);?>>
                            <?php echo wp_kses_post( $settings['desc'] ); ?>
                        </div>
                    <?php endif; ?>
                    <div class="services-slides owl-carousel owl-theme">
                        <?php while($services_array->have_posts()): $services_array->the_post();
                            // ACF field access
                            if (class_exists( 'ACF') && get_field('service_icon_image')){
                                $icon_img      = get_field('service_icon_image');
                            } else {
                                $icon_img      = '';
                            }
                            $id = get_the_ID();
                        ?>
                        <div class="single-services-box">
                            <?php if( !empty( $icon_img ) ) : ?>
                                <div class="icon">
                                    <img src="<?php echo esc_url( $icon_img  ); ?>" alt="<?php echo esc_attr__('services-icon','cyarb-toolkit'); ?>">
                                </div>
                            <?php endif; ?>

                            <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
                            <p><?php echo esc_html(wp_trim_words( get_the_excerpt(), $settings['excerpt_num'], '' )); ?></p>

                            <?php if ( 'yes' === $settings['read_button_show'] ) : ?>
                                <a href="<?php the_permalink(); ?>" class="link-btn"><?php echo esc_html( $settings['read_more_btntext'] ); ?> <i class="lni lni-chevron-right"></i></a>
                            <?php endif; ?>
                        </div>
                        <?php endwhile; wp_reset_query(); ?>
                    </div>
                    <?php if ( 'yes' === $settings['button_show'] ) : ?>
                        <?php if($btn1_text != '' ) { ?>
                            <div class="view-more-box">
                                <?php if ( 'yes' === $settings['target_page'] ) { ?>
                                    <a target="_blank" href="<?php echo esc_url($link_source); ?>" class="default-btn">
                                        <span><?php echo esc_html($btn1_text); ?></span>
                                    </a>
                                <?php } else { ?>
                                    <a href="<?php echo esc_url($link_source); ?>" class="default-btn">
                                        <span><?php echo esc_html($btn1_text); ?></span>
                                    </a>
                                <?php } ?>
                            </div><?php  
                        } ?>
                    <?php endif; ?>
                </div>

                <?php if ( 'yes' === $settings['image_shape'] ) : ?>
                    <?php if( $settings['shape1']['url'] != '' ) : ?>
                        <div class="shape1"> <img src="<?php echo esc_url( $settings['shape1']['url'] ); ?>" alt="<?php echo esc_attr__( 'Shape' ); ?>"></div>
                    <?php endif; ?>
                    <?php if( $settings['shape2']['url'] != '' ) : ?>
                        <div class="shape3"><img src="<?php echo esc_url( $settings['shape2']['url'] ); ?>" alt="<?php echo esc_attr__( 'Shape' ); ?>"></div>
                    <?php endif; ?>
                    <?php if( $settings['shape3']['url'] != '' ) : ?>
                        <div class="shape6"><img src="<?php echo esc_url( $settings['shape3']['url'] ); ?>" alt="<?php echo esc_attr__( 'Shape' ); ?>"></div>
                    <?php endif; ?>
                <?php endif; ?>
            </div>
        <?php endif; ?>

        <?php
	}

}

Plugin::instance()->widgets_manager->register_widget_type( new Cyarb_Features_Area );