start_controls_section( 'testimonials_carousel', [ 'label' => esc_html__('Thinkai Testimonials Carousel', 'thinkai'), ] ); //Layout $this->add_control( 'layout_control', [ 'label' => esc_html__( 'Layout Style', 'thinkai' ), 'label_block' => true, 'type' => Controls_Manager::SELECT, 'default' => '1', 'options' => array( '1' => esc_html__( 'Style One ', 'thinkai'), '2' => esc_html__( 'Style Two ', 'thinkai'), '3' => esc_html__( 'Style Three ', 'thinkai'), '4' => esc_html__( 'Style Four ', 'thinkai'), ), ] ); $this->add_control( 'total_ratting', [ 'label' => __( 'Total Ratting', 'thinkai' ), 'type' => Controls_Manager::TEXT, 'label_block' => true, 'dynamic' => [ 'active' => true, ], 'default' => esc_html__( '4.9/5.0', 'thinkai' ), 'condition' => [ 'layout_control' => '1' ] ] ); $this->add_control( 'ratting_description', [ 'label' => __( 'Ratting Description', 'thinkai' ), 'type' => Controls_Manager::TEXT, 'label_block' => true, 'dynamic' => [ 'active' => true, ], 'default' => esc_html__( '(from 20k reviews)', 'thinkai' ), 'condition' => [ 'layout_control' => '1' ] ] ); $this->add_control( 'text_limit', [ 'label' => esc_html__('Text Limit', 'thinkai'), 'type' => Controls_Manager::NUMBER, 'default' => 3, 'min' => 1, 'max' => 100, 'step' => 1, ] ); $this->add_control( 'query_number', [ 'label' => esc_html__('Number of post', 'thinkai'), 'type' => Controls_Manager::NUMBER, 'default' => 3, 'min' => 1, 'max' => 100, 'step' => 1, ] ); $this->add_control( 'query_orderby', [ 'label' => esc_html__('Order By', 'thinkai'), 'type' => Controls_Manager::SELECT, 'default' => 'date', 'options' => array( 'date' => esc_html__('Date', 'thinkai'), 'title' => esc_html__('Title', 'thinkai'), 'menu_order' => esc_html__('Menu Order', 'thinkai'), 'rand' => esc_html__('Random', 'thinkai'), ), ] ); $this->add_control( 'query_order', [ 'label' => esc_html__('Order', 'thinkai'), 'label_block' => true, 'type' => Controls_Manager::SELECT, 'default' => 'DESC', 'options' => array( 'DESC' => esc_html__('DESC', 'thinkai'), 'ASC' => esc_html__('ASC', 'thinkai'), ), ] ); $this->add_control( 'query_category', [ 'type' => Controls_Manager::SELECT2, 'label' => esc_html__('Category', 'thinkai'), 'label_block' => true, 'multiple' => true, 'options' => get_testimonials_categories() ] ); $this->end_controls_section(); //Next Prev Color Style $this->start_controls_section( 'next_prev_color_style', [ 'label' => esc_html__( 'Next Prev Settings', 'thinkai' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'next_prev_color', [ 'label' => esc_html__( 'Text Color', 'thinkai' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .testimonial-style3__items-nav .swiper-button-next' => 'color: {{VALUE}} !important;', '{{WRAPPER}} .testimonial-style3__items-nav .swiper-button-prev' => 'color: {{VALUE}} !important;', ], ] ); $this->end_controls_section(); } /** * Render button widget output on the frontend. * Written in PHP and used to generate the final HTML. * * @since 1.0.0 * @access protected */ protected function render() { $settings = $this->get_settings_for_display(); $allowed_tags = wp_kses_allowed_html('post'); $layout = $settings['layout_control']; $paged = thinkai_set($_POST, 'paged') ? esc_attr($_POST['paged']) : 1; $this->add_render_attribute('wrapper', 'class', 'templatepath-thinkai'); $args = array( 'post_type' => 'testimonials', 'posts_per_page' => thinkai_set($settings, 'query_number'), 'orderby' => thinkai_set($settings, 'query_orderby'), 'order' => thinkai_set($settings, 'query_order'), 'paged' => $paged ); if (thinkai_set($settings, 'query_category')) {$args['testimonials_cat'] = thinkai_set($settings, 'query_category'); }$query = new \WP_Query($args); if ($query->have_posts()) { ?>
have_posts()) : $query->the_post(); ?>
<?php bloginfo( 'name' ); ?>

    '; else echo '
  • '; } ?>