PATH:
home
/
lab2454c
/
mact34.com
/
wp-content
/
plugins
/
tryo-toolkit
/
widgets
<?php /** * Banner Feature Widget */ namespace Elementor; class Tryo_Banner_Feature extends Widget_Base { public function get_name() { return 'Banner_Feature'; } public function get_title() { return __( 'Banner 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( '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->add_control( 'read_more_text', [ 'label' => __( 'Feature Read More Text', 'tryo-toolkit' ), 'type' => Controls_Manager::TEXT, 'default' => __('Read More', 'tryo-toolkit'), ] ); $this->end_controls_section(); } protected function render() { $settings = $this->get_settings_for_display(); 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 ); ?> <div class="featured-boxes-area"> <div class="container"> <div class="featured-boxes-inner"> <div class="row m-0"> <?php while($feature_array->have_posts()): $feature_array->the_post(); $icon = get_field('select_icon'); $icon_color = get_field('icon_color'); ?> <div class="col-lg-3 col-sm-6 col-md-6 p-0"> <div class="single-featured-box"> <div class="icon" style="color:<?php echo esc_attr( $icon_color ); ?>"> <i class="<?php echo esc_attr( $icon ); ?>"></i> </div> <h3><?php the_title(); ?></h3> <p><?php the_excerpt(); ?></p> <a href="<?php the_permalink(); ?>" class="read-more-btn"><?php echo esc_html( $settings['read_more_text'] ); ?></a> </div> </div> <?php endwhile; ?> <?php wp_reset_query(); ?> </div> </div> </div> </div> <?php } protected function _content_template() {} } Plugin::instance()->widgets_manager->register_widget_type( new Tryo_Banner_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]