PATH:
home
/
lab2454c
/
mact34.com
/
wp-content
/
plugins
/
tryo-toolkit
/
widgets
<?php /** * Feature Widget */ namespace Elementor; class Tryo_Feature extends Widget_Base { public function get_name() { return 'Tryo_Feature'; } public function get_title() { return __( 'Feature', 'tryo-toolkit' ); } public function get_icon() { return 'eicon-star-o'; } public function get_categories() { return [ 'tryo-elements' ]; } protected function _register_controls() { $this->start_controls_section( 'feature_section', [ 'label' => __( 'Feature Control', 'tryo-toolkit' ), 'tab' => Controls_Manager::TAB_CONTENT, ] ); $this->add_control( 'feature', [ 'label' => __( 'Feature Style', 'tryo-toolkit' ), 'type' => Controls_Manager::SELECT, 'default' => 'without_image', 'options' => [ 'without_image' => __( 'Without Image', 'tryo-toolkit' ), 'with_image' => __( 'With Image', 'tryo-toolkit' ), ], ] ); $this->add_control( 'image', [ 'label' => __( 'Section Image', 'tryo-toolkit' ), 'type' => Controls_Manager::MEDIA, 'default' => [ 'url' => Utils::get_placeholder_image_src(), ], 'condition' => [ 'feature' => 'with_image', ] ] ); $this->add_control( 'cat_name', [ 'label' => __( 'Select Category', 'tryo-toolkit' ), 'type' => Controls_Manager::SELECT, 'options' => tryo_toolkit_get_feature_cat_list(), ] ); $this->add_control( 'order', [ 'label' => __( 'Feature Order By', 'tryo-toolkit' ), 'type' => Controls_Manager::SELECT, 'options' => [ 'DESC' => __( 'DESC', 'tryo-toolkit' ), 'ASC' => __( 'ASC', 'tryo-toolkit' ), ], 'default' => 'DESC', ] ); $this->add_control( 'count', [ 'label' => __( 'Post Per Page', 'tryo-toolkit' ), 'type' => Controls_Manager::NUMBER, 'default' => 3, ] ); $this->end_controls_section(); } protected function render() { $settings = $this->get_settings_for_display(); global $tryo_opt; if( isset( $tryo_opt['enable_lazyloader'] ) ): $is_lazyloader = $tryo_opt['enable_lazyloader']; else: $is_lazyloader = true; endif; if( $is_lazyloader == true ): $lazy_class = 'smartify'; $lazy_attr = 'sm-'; else: $lazy_class = ''; $lazy_attr = ''; endif; if( $settings['cat_name'] != '' ) { $args = array( 'post_type' => 'feature', 'posts_per_page' => $settings['count'], 'order' => $settings['order'], 'tax_query' => array( array( 'taxonomy' => 'feature_cat', 'field' => 'slug', 'terms' => $settings['cat_name'], 'hide_empty' => false ) ) ); } else { $args = array( 'post_type' => 'feature', 'posts_per_page' => $settings['count'], 'order' => $settings['order'] ); } $feature_array = new \WP_Query( $args ); ?> <?php if( $settings['feature'] == 'without_image' ): ?> <div class="container"> <div class="row"> <?php while($feature_array->have_posts()): $feature_array->the_post(); $icon = get_field('select_icon'); $icon_color = get_field('icon_color'); $icon_bg = get_field('icon_background_color'); if ( class_exists('ACF') && get_field('choose_link_type') == 1 ) { $post_link = get_the_permalink(); } else { $post_link = get_field('external_link'); } ?> <div class="col-lg-4 col-md-6"> <div class="single-features-box"> <div class="icon" style="color:<?php echo esc_attr( $icon_color ); ?>; background-color: <?php echo esc_attr( $icon_bg ); ?>;"> <i class="<?php echo esc_attr( $icon ); ?>"></i> </div> <h3><a href="<?php echo esc_url( $post_link ); ?>"><?php the_title(); ?></a></h3> <p><?php the_excerpt(); ?></p> </div> </div> <?php endwhile; ?> <?php wp_reset_query(); ?> </div> </div> <?php else: ?> <div class="container-fluid"> <div class="row align-items-center"> <div class="col-lg-5 col-md-12"> <div class="features-box-list"> <div class="row"> <?php while($feature_array->have_posts()): $feature_array->the_post(); $icon = get_field('select_icon'); $icon_color = get_field('icon_color'); $icon_bg = get_field('icon_background_color'); if ( class_exists('ACF') && get_field('choose_link_type') == 1 ) { $post_link = get_the_permalink(); } else { $post_link = get_field('external_link'); } ?> <div class="col-lg-12 col-md-6"> <div class="features-box"> <div class="icon" style="color:<?php echo esc_attr( $icon_color ); ?>; background-color: <?php echo esc_attr( $icon_bg ); ?>;"> <i class="<?php echo esc_attr( $icon ); ?>"></i> </div> <h3><a href="<?php echo esc_url( $post_link ); ?>"><?php the_title(); ?></a></h3> <p><?php the_excerpt(); ?></p> </div> </div> <?php endwhile; ?> <?php wp_reset_query(); ?> </div> </div> </div> <div class="col-lg-7 col-md-12"> <div class="features-image"> <?php if( $settings['image']['url'] != '' ): ?> <img class="<?php echo esc_attr($lazy_class); ?>" <?php echo esc_attr($lazy_attr); ?>src="<?php echo esc_url( $settings['image']['url'] ); ?>" alt="<?php echo esc_attr__( 'Feature', 'tryo-toolkit' ); ?>"> <?php endif; ?> </div> </div> </div> </div> <?php endif; ?> <?php } protected function _content_template() {} } Plugin::instance()->widgets_manager->register_widget_type( new Tryo_Feature );
[-] banner-feature.php
[edit]
[-] profile-form.php
[edit]
[-] business-area.php
[edit]
[-] services-two.php
[edit]
[-] banner-two.php
[edit]
[-] signup.php
[edit]
[+]
..
[-] payment-experience-area.php
[edit]
[-] post.php
[edit]
[-] works.php
[edit]
[-] account-create.php
[edit]
[-] comparisons-table.php
[edit]
[-] partner-slider.php
[edit]
[-] app-download.php
[edit]
[-] feature-box.php
[edit]
[-] team.php
[edit]
[-] global-area.php
[edit]
[-] userinfo-details.php
[edit]
[-] banner-three.php
[edit]
[-] pricing.php
[edit]
[-] success-story-area.php
[edit]
[-] contact-card.php
[edit]
[-] contact-cta-box.php
[edit]
[-] services-area.php
[edit]
[-] ready-to-talk.php
[edit]
[-] section.php
[edit]
[-] receive-details.php
[edit]
[-] about-area.php
[edit]
[-] banner-four.php
[edit]
[-] send-details.php
[edit]
[-] support-area.php
[edit]
[-] invoicing.php
[edit]
[-] testimonials.php
[edit]
[-] funfact.php
[edit]
[-] signin.php
[edit]
[-] information-box.php
[edit]
[-] new-payment.php
[edit]
[-] banner-one.php
[edit]
[-] feedback-card.php
[edit]
[-] feature.php
[edit]