📁 File Manager Pro
v10.0.2 | PHP: 8.1.34
Server: LiteSpeed
2026-06-26 10:28:35
📂
/
/
home
/
pallabnv
/
public_html
/
wp-content__3bb9dea
/
themes
/
berich
/
elements
/
widgets
✏️
Editing: pxl_post_carousel.php
<?php $pt_supports = ['post','portfolio','service']; pxl_add_custom_widget( array( 'name' => 'pxl_post_carousel', 'title' => esc_html__('Case Post Carousel', 'berich' ), 'icon' => 'eicon-posts-carousel', 'categories' => array('pxltheme-core'), 'scripts' => array( 'swiper', 'pxl-swiper', ), 'params' => array( 'sections' => array( array( 'name' => 'layout_section', 'label' => esc_html__( 'Layout', 'berich' ), 'tab' => 'layout', 'controls' => array_merge( array( array( 'name' => 'post_type', 'label' => esc_html__( 'Select Post Type', 'berich' ), 'type' => 'select', 'multiple' => true, 'options' => berich_get_post_type_options($pt_supports), 'default' => 'post' ) ), berich_get_post_carousel_layout($pt_supports) ), ), array( 'name' => 'section_source', 'label' => esc_html__('Source', 'berich' ), 'tab' => \Elementor\Controls_Manager::TAB_SETTINGS, 'controls' => array_merge( array( array( 'name' => 'select_post_by', 'label' => esc_html__( 'Select posts by', 'berich' ), 'type' => 'select', 'multiple' => true, 'options' => [ 'term_selected' => esc_html__( 'Terms selected', 'berich' ), 'post_selected' => esc_html__( 'Posts selected ', 'berich' ), ], 'default' => 'term_selected' ) ), berich_get_grid_term_by_posttype($pt_supports, ['custom_condition' => ['select_post_by' => 'term_selected']]), berich_get_grid_ids_by_posttype($pt_supports, ['custom_condition' => ['select_post_by' => 'post_selected']]), array( array( 'name' => 'orderby', 'label' => esc_html__('Order By', 'berich' ), 'type' => \Elementor\Controls_Manager::SELECT, 'default' => 'date', 'options' => [ 'date' => esc_html__('Date', 'berich' ), 'ID' => esc_html__('ID', 'berich' ), 'author' => esc_html__('Author', 'berich' ), 'title' => esc_html__('Title', 'berich' ), 'rand' => esc_html__('Random', 'berich' ), ], ), array( 'name' => 'order', 'label' => esc_html__('Sort Order', 'berich' ), 'type' => \Elementor\Controls_Manager::SELECT, 'default' => 'desc', 'options' => [ 'desc' => esc_html__('Descending', 'berich' ), 'asc' => esc_html__('Ascending', 'berich' ), ], ), array( 'name' => 'limit', 'label' => esc_html__('Total items', 'berich' ), 'type' => \Elementor\Controls_Manager::NUMBER, 'default' => '6', ), ) ), ), array( 'name' => 'section_carousel', 'label' => esc_html__('Carousel', 'berich'), 'tab' => \Elementor\Controls_Manager::TAB_SETTINGS, 'controls' => array( array( 'name' => 'pxl_animate', 'label' => esc_html__('Berich Animate', 'berich' ), 'type' => \Elementor\Controls_Manager::SELECT, 'options' => berich_widget_animate(), 'default' => '', ), array( 'name' => 'col_xs', 'label' => esc_html__('Columns XS Devices', 'berich' ), 'type' => \Elementor\Controls_Manager::SELECT, 'default' => '1', 'options' => [ '1' => '1', '2' => '2', '3' => '3', '4' => '4', '6' => '6', ], ), array( 'name' => 'col_sm', 'label' => esc_html__('Columns SM Devices', 'berich' ), 'type' => \Elementor\Controls_Manager::SELECT, 'default' => '2', 'options' => [ '1' => '1', '2' => '2', '3' => '3', '4' => '4', '6' => '6', ], ), array( 'name' => 'col_md', 'label' => esc_html__('Columns MD Devices', 'berich' ), 'type' => \Elementor\Controls_Manager::SELECT, 'default' => '2', 'options' => [ '1' => '1', '2' => '2', '3' => '3', '4' => '4', '6' => '6', 'custom' => 'custom', ], ), array( 'name' => 'col_md_custom', 'label' => esc_html__('Columns MD Custom', 'berich' ), 'type' => \Elementor\Controls_Manager::TEXT, 'label_block' => true, 'description' => 'Enter number.', 'condition' => [ 'col_md' => 'custom', ], ), array( 'name' => 'col_lg', 'label' => esc_html__('Columns LG Devices', 'berich' ), 'type' => \Elementor\Controls_Manager::SELECT, 'default' => '3', 'options' => [ '1' => '1', '2' => '2', '3' => '3', '4' => '4', '6' => '6', 'custom' => 'custom', ], ), array( 'name' => 'col_lg_custom', 'label' => esc_html__('Columns LG Custom', 'berich' ), 'type' => \Elementor\Controls_Manager::TEXT, 'label_block' => true, 'description' => 'Enter number.', 'condition' => [ 'col_lg' => 'custom', ], ), array( 'name' => 'col_xl', 'label' => esc_html__('Columns XL Devices', 'berich' ), 'type' => \Elementor\Controls_Manager::SELECT, 'default' => '3', 'options' => [ '1' => '1', '2' => '2', '3' => '3', '4' => '4', '5' => '5', '6' => '6', 'custom' => 'custom', ], ), array( 'name' => 'col_xl_custom', 'label' => esc_html__('Columns XL Custom', 'berich' ), 'type' => \Elementor\Controls_Manager::TEXT, 'label_block' => true, 'description' => 'Enter number.', 'condition' => [ 'col_xl' => 'custom', ], ), array( 'name' => 'col_xxl', 'label' => esc_html__('Columns XXL Devices', 'berich' ), 'type' => \Elementor\Controls_Manager::SELECT, 'default' => '3', 'options' => [ '1' => '1', '2' => '2', '3' => '3', '4' => '4', '5' => '5', '6' => '6', 'custom' => 'custom', ], ), array( 'name' => 'col_xxl_custom', 'label' => esc_html__('Columns XXL Custom', 'berich' ), 'type' => \Elementor\Controls_Manager::TEXT, 'label_block' => true, 'description' => 'Enter number.', 'condition' => [ 'col_xxl' => 'custom', ], ), array( 'name' => 'slides_to_scroll', 'label' => esc_html__('Slides to scroll', 'berich' ), 'type' => \Elementor\Controls_Manager::SELECT, 'default' => '1', 'options' => [ '1' => '1', '2' => '2', '3' => '3', '4' => '4', '5' => '5', '6' => '6', ], ), array( 'name' => 'arrows', 'label' => esc_html__('Show Arrows', 'berich'), 'type' => \Elementor\Controls_Manager::SWITCHER, 'default' => false, ), array( 'name' => 'pagination', 'label' => esc_html__('Show Pagination', 'berich'), 'type' => \Elementor\Controls_Manager::SWITCHER, 'default' => false, ), array( 'name' => 'pagination_type', 'label' => esc_html__('Pagination Type', 'berich' ), 'type' => \Elementor\Controls_Manager::SELECT, 'default' => 'bullets', 'options' => [ 'bullets' => 'Bullets', 'fraction' => 'Fraction', 'progressbar' => 'Progressbar', ], 'condition' => [ 'pagination' => 'true' ] ), array( 'name' => 'pause_on_hover', 'label' => esc_html__('Pause on Hover', 'berich'), 'type' => \Elementor\Controls_Manager::SWITCHER, 'default' => false, ), array( 'name' => 'autoplay', 'label' => esc_html__('Autoplay', 'berich'), 'type' => \Elementor\Controls_Manager::SWITCHER, 'default' => false, ), array( 'name' => 'autoplay_speed', 'label' => esc_html__('Autoplay Delay', 'berich'), 'type' => \Elementor\Controls_Manager::NUMBER, 'default' => 5000, 'condition' => [ 'autoplay' => 'true' ] ), array( 'name' => 'infinite', 'label' => esc_html__('Infinite Loop', 'berich'), 'type' => \Elementor\Controls_Manager::SWITCHER, 'default' => false, ), array( 'name' => 'speed', 'label' => esc_html__('Animation Speed', 'berich'), 'type' => \Elementor\Controls_Manager::NUMBER, 'default' => 500, ), array( 'name' => 'drap', 'label' => esc_html__('Show Scroll Drap', 'berich'), 'type' => \Elementor\Controls_Manager::SWITCHER, 'default' => false, ), ), ), array( 'name' => 'section_display', 'label' => esc_html__('Display', 'berich' ), 'tab' => \Elementor\Controls_Manager::TAB_SETTINGS, 'controls' => array( array( 'name' => 'img_size', 'label' => esc_html__('Image Size', 'berich' ), 'type' => \Elementor\Controls_Manager::TEXT, 'description' => 'Enter image size (Example: "thumbnail", "medium", "large", "full" or other sizes defined by theme). Alternatively enter size in pixels (Default: 370x300 (Width x Height)).', 'conditions' => [ 'relation' => 'or', 'terms' => [ [ 'terms' => [ ['name' => 'post_type', 'operator' => '==', 'value' => 'post'], ['name' => 'layout_post', 'operator' => 'in', 'value' => ['post-1']] ] ], [ 'terms' => [ ['name' => 'post_type', 'operator' => '==', 'value' => 'portfolio'], ['name' => 'layout_portfolio', 'operator' => 'in', 'value' => ['portfolio-1']] ] ], [ 'terms' => [ ['name' => 'post_type', 'operator' => '==', 'value' => 'service'], ['name' => 'layout_service', 'operator' => 'in', 'value' => ['service-1']] ] ] ], ] ), array( 'name' => 'show_date', 'label' => esc_html__('Show Date', 'berich' ), 'type' => \Elementor\Controls_Manager::SWITCHER, 'default' => 'true', 'conditions' => [ 'relation' => 'or', 'terms' => [ [ 'terms' => [ ['name' => 'post_type', 'operator' => '==', 'value' => 'post'], ['name' => 'layout_post', 'operator' => 'in', 'value' => ['post-1','post-2','post-3']] ] ] ], ] ), array( 'name' => 'show_category', 'label' => esc_html__('Show Category', 'berich' ), 'type' => \Elementor\Controls_Manager::SWITCHER, 'default' => 'true', 'conditions' => [ 'relation' => 'or', 'terms' => [ [ 'terms' => [ ['name' => 'post_type', 'operator' => '==', 'value' => 'post'], ['name' => 'layout_post', 'operator' => 'in', 'value' => ['post-1','post-3']] ] ], [ 'terms' => [ ['name' => 'post_type', 'operator' => '==', 'value' => 'portfolio'], ['name' => 'layout_portfolio', 'operator' => 'in', 'value' => ['portfolio-2']] ] ], [ 'terms' => [ ['name' => 'post_type', 'operator' => '==', 'value' => 'service'], ['name' => 'layout_service', 'operator' => 'in', 'value' => ['service-1']] ] ] ], ] ), array( 'name' => 'show_author', 'label' => esc_html__('Show Author', 'berich' ), 'type' => \Elementor\Controls_Manager::SWITCHER, 'default' => 'true', 'conditions' => [ 'relation' => 'or', 'terms' => [ [ 'terms' => [ ['name' => 'post_type', 'operator' => '==', 'value' => 'post'], ['name' => 'layout_post', 'operator' => 'in', 'value' => ['post-1','post-2']] ] ] ], ] ), array( 'name' => 'show_excerpt', 'label' => esc_html__('Show Excerpt', 'berich' ), 'type' => \Elementor\Controls_Manager::SWITCHER, 'default' => 'true', 'conditions' => [ 'relation' => 'or', 'terms' => [ [ 'terms' => [ ['name' => 'post_type', 'operator' => '==', 'value' => 'portfolio'], ['name' => 'layout_portfolio', 'operator' => 'in', 'value' => ['portfolio-1']] ] ], [ 'terms' => [ ['name' => 'post_type', 'operator' => '==', 'value' => 'post'], ['name' => 'layout_post', 'operator' => 'in', 'value' => ['post-2']] ] ], [ 'terms' => [ ['name' => 'post_type', 'operator' => '==', 'value' => 'service'], ['name' => 'layout_service', 'operator' => 'in', 'value' => ['service-1']] ] ] ], ] ), array( 'name' => 'num_words', 'label' => esc_html__('Number of Words', 'berich' ), 'type' => \Elementor\Controls_Manager::NUMBER, 'default' => 25, 'separator' => 'after', 'conditions' => [ 'relation' => 'or', 'terms' => [ [ 'terms' => [ ['name' => 'post_type', 'operator' => '==', 'value' => 'portfolio'], ['name' => 'layout_portfolio', 'operator' => 'in', 'value' => ['portfolio-1']], ['name' => 'show_excerpt', 'operator' => '==', 'value' => 'true'], ] ], [ 'terms' => [ ['name' => 'post_type', 'operator' => '==', 'value' => 'post'], ['name' => 'layout_post', 'operator' => 'in', 'value' => ['post-2']], ['name' => 'show_excerpt', 'operator' => '==', 'value' => 'true'], ] ], [ 'terms' => [ ['name' => 'post_type', 'operator' => '==', 'value' => 'service'], ['name' => 'layout_service', 'operator' => 'in', 'value' => ['service-1']], ['name' => 'show_excerpt', 'operator' => '==', 'value' => 'true'], ] ] ], ] ), array( 'name' => 'show_button', 'label' => esc_html__('Show Button Readmore', 'berich' ), 'type' => \Elementor\Controls_Manager::SWITCHER, 'default' => 'true', 'conditions' => [ 'relation' => 'or', 'terms' => [ [ 'terms' => [ ['name' => 'post_type', 'operator' => '==', 'value' => 'portfolio'], ['name' => 'layout_portfolio', 'operator' => 'in', 'value' => ['portfolio-1']] ] ], [ 'terms' => [ ['name' => 'post_type', 'operator' => '==', 'value' => 'service'], ['name' => 'layout_service', 'operator' => 'in', 'value' => ['service-1']] ] ], [ 'terms' => [ ['name' => 'post_type', 'operator' => '==', 'value' => 'post'], ['name' => 'layout_post', 'operator' => 'in', 'value' => ['post-3']] ] ] ], ] ), array( 'name' => 'button_text', 'label' => esc_html__('Button Text', 'berich' ), 'type' => \Elementor\Controls_Manager::TEXT, 'conditions' => [ 'relation' => 'or', 'terms' => [ [ 'terms' => [ ['name' => 'post_type', 'operator' => '==', 'value' => 'portfolio'], ['name' => 'layout_portfolio', 'operator' => 'in', 'value' => ['portfolio-1']], ['name' => 'show_button', 'operator' => '==', 'value' => 'true'] ] ], [ 'terms' => [ ['name' => 'post_type', 'operator' => '==', 'value' => 'service'], ['name' => 'layout_service', 'operator' => 'in', 'value' => ['service-1']], ['name' => 'show_button', 'operator' => '==', 'value' => 'true'] ] ], [ 'terms' => [ ['name' => 'post_type', 'operator' => '==', 'value' => 'post'], ['name' => 'layout_post', 'operator' => 'in', 'value' => ['post-3']], ['name' => 'show_button', 'operator' => '==', 'value' => 'true'] ] ] ], ] ), ), ), array( 'name' => 'section_style_title', 'label' => esc_html__('Style', 'berich'), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, 'controls' => array( array( 'name' => 'title_color', 'label' => esc_html__('Color', 'berich' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .pxl-swiper-slider .pxl-post--title' => 'color: {{VALUE}};', ], ), array( 'name' => 'title_typography', 'label' => esc_html__('Typography', 'berich' ), 'type' => \Elementor\Group_Control_Typography::get_type(), 'control_type' => 'group', 'selector' => '{{WRAPPER}} .pxl-swiper-slider .pxl-post--title', ), array( 'name' => 'date_color', 'label' => esc_html__('Date Color', 'berich' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .pxl-swiper-slider .pxl-post--date' => 'color: {{VALUE}};', ], 'conditions' => [ 'relation' => 'or', 'terms' => [ [ 'terms' => [ ['name' => 'post_type', 'operator' => '==', 'value' => 'post'], ['name' => 'layout_post', 'operator' => 'in', 'value' => ['post-1']], ] ] ], ] ), array( 'name' => 'author_title_color', 'label' => esc_html__('Author Title Color', 'berich' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .pxl-swiper-slider .pxl-post--author .pxl-author-meta h6' => 'color: {{VALUE}};', ], 'conditions' => [ 'relation' => 'or', 'terms' => [ [ 'terms' => [ ['name' => 'post_type', 'operator' => '==', 'value' => 'post'], ['name' => 'layout_post', 'operator' => 'in', 'value' => ['post-1']], ] ] ], ] ), array( 'name' => 'author_position_color', 'label' => esc_html__('Author Position Color', 'berich' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .pxl-swiper-slider .pxl-post--author .pxl-author-meta span' => 'color: {{VALUE}};', ], 'conditions' => [ 'relation' => 'or', 'terms' => [ [ 'terms' => [ ['name' => 'post_type', 'operator' => '==', 'value' => 'post'], ['name' => 'layout_post', 'operator' => 'in', 'value' => ['post-1']], ] ] ], ] ), array( 'name' => 'category_box_color', 'label' => esc_html__('Category Box Color', 'berich' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .pxl-swiper-slider .pxl-post--meta .pxl-post--category a' => 'background-color: {{VALUE}};border-color: {{VALUE}};', ], 'conditions' => [ 'relation' => 'or', 'terms' => [ [ 'terms' => [ ['name' => 'post_type', 'operator' => '==', 'value' => 'post'], ['name' => 'layout_post', 'operator' => 'in', 'value' => ['post-1']], ] ] ], ] ), array( 'name' => 'content_color', 'label' => esc_html__('Content Color', 'berich' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .pxl-swiper-slider .pxl-post--content' => 'color: {{VALUE}};', ], 'conditions' => [ 'relation' => 'or', 'terms' => [ [ 'terms' => [ ['name' => 'post_type', 'operator' => '==', 'value' => 'portfolio'], ['name' => 'layout_portfolio', 'operator' => 'in', 'value' => ['portfolio-1']], ] ], ], ] ), array( 'name' => 'readmore_color', 'label' => esc_html__('Readmore Color', 'berich' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .pxl-swiper-slider .pxl-post--button a' => 'color: {{VALUE}};', ], 'conditions' => [ 'relation' => 'or', 'terms' => [ [ 'terms' => [ ['name' => 'post_type', 'operator' => '==', 'value' => 'portfolio'], ['name' => 'layout_portfolio', 'operator' => 'in', 'value' => ['portfolio-1']], ] ], ], ] ), ), ), array( 'name' => 'section_style_excerpt', 'label' => esc_html__('Excerpt', 'berich'), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, 'conditions' => [ 'relation' => 'or', 'terms' => [ [ 'terms' => [ ['name' => 'post_type', 'operator' => '==', 'value' => 'service'], ['name' => 'layout_service', 'operator' => 'in', 'value' => ['service-1']] ] ] ], ], 'controls' => array( array( 'name' => 'excerpt_color', 'label' => esc_html__('Color', 'berich' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .pxl-post-carousel .pxl-post--content' => 'color: {{VALUE}};', ], ), array( 'name' => 'excerpt_typography', 'label' => esc_html__('Typography', 'berich' ), 'type' => \Elementor\Group_Control_Typography::get_type(), 'control_type' => 'group', 'selector' => '{{WRAPPER}} .pxl-post-carousel .pxl-post--content', ), ), ), ), ), ), berich_get_class_widget_path() );
💾 Save Changes
❌ Cancel