start_controls_section( "general_section", [ "label" => esc_html__( "General", "zegen-core" ), "tab" => \Elementor\Controls_Manager::TAB_CONTENT, "description" => esc_html__( "Default sermon options.", "zegen-core" ), ] ); $this->add_control( "extra_class", [ "type" => \Elementor\Controls_Manager::TEXT, "label" => esc_html__( "Extra Class", "zegen-core" ), "description" => esc_html__( "Put extra class for some additional styles.", "zegen-core" ), ] ); $this->add_control( "post_per_page", [ "type" => \Elementor\Controls_Manager::TEXT, "label" => esc_html__( "Post Per Page", "zegen-core" ), "description" => esc_html__( "Here you can define post limits per page. Example 10", "zegen-core" ), "default" => "10", "placeholder" => "10" ] ); $this->add_control( "excerpt_length", [ "type" => \Elementor\Controls_Manager::TEXT, "label" => esc_html__( "Excerpt Length", "zegen-core" ), "description" => esc_html__( "Here you can define post excerpt length. Example 10", "zegen-core" ), "default" => "15" ] ); $this->add_control( "more_text", [ "type" => \Elementor\Controls_Manager::TEXT, "label" => esc_html__( "Read More Text", "zegen-core" ), "description" => esc_html__( "Here you can enter read more text instead of default text.", "zegen-core" ), "default" => esc_html__( "Read More", "zegen-core" ) ] ); $this->end_controls_section(); //Filter Section $this->start_controls_section( "filter_section", [ "label" => esc_html__( "Filter", "zegen-core" ), "tab" => \Elementor\Controls_Manager::TAB_CONTENT, "description" => esc_html__( "Sermon filter options here available.", "zegen-core" ), ] ); $this->add_control( "sermon_cats", [ "type" => \Elementor\Controls_Manager::TEXT, "label" => esc_html__( "Enter Categories Id", "zegen-core" ), "description" => esc_html__( "Here you can enter sermon categoeis id. Example 4, 5, 7", "zegen-core" ), "default" => '' ] ); $this->add_control( "sermon_preachers", [ "type" => \Elementor\Controls_Manager::TEXT, "label" => esc_html__( "Enter Preacher Id", "zegen-core" ), "description" => esc_html__( "Here you can enter sermon preacher id. Example 4, 5, 7", "zegen-core" ), "default" => '' ] ); $this->add_control( "sermon_ids", [ "type" => \Elementor\Controls_Manager::TEXT, "label" => esc_html__( "Enter Sermon Id's", "zegen-core" ), "description" => esc_html__( "Here you can enter sermon post id's for get specific sermon. Example 4, 5, 7", "zegen-core" ), "default" => '' ] ); $this->add_control( "pagination", [ "label" => esc_html__( "Pagination", "zegen-core" ), "type" => "toggleswitch", "default" => "0" ] ); $this->end_controls_section(); //Layouts Section $this->start_controls_section( "layouts_section", [ "label" => esc_html__( "Layouts", "zegen-core" ), "tab" => \Elementor\Controls_Manager::TAB_CONTENT, "description" => esc_html__( "Sermon layout options here available.", "zegen-core" ), ] ); $this->add_control( "heading_tag", [ "label" => esc_html__( "Heading Tag", "zegen-core" ), "type" => \Elementor\Controls_Manager::SELECT, "default" => "h3", "options" => [ "h1" => esc_html__( "Heading 1", "zegen-core" ), "h2" => esc_html__( "Heading 2", "zegen-core" ), "h3" => esc_html__( "Heading 3", "zegen-core" ), "h4" => esc_html__( "Heading 4", "zegen-core" ), "h5" => esc_html__( "Heading 5", "zegen-core" ), "h6" => esc_html__( "Heading 6", "zegen-core" ), ] ] ); $this->add_control( "font_color", [ "type" => \Elementor\Controls_Manager::COLOR, "label" => esc_html__( "Font Color", "zegen-core" ), "description" => esc_html__( "Here you can put the font color.", "zegen-core" ), "default" => "", 'selectors' => [ '{{WRAPPER}} .sermon-wrapper' => 'color: {{VALUE}};', '{{WRAPPER}} .sermon-wrapper.sermon-dark .sermon-inner' => 'color: {{VALUE}};' ], ] ); $this->add_control( "sermon_layout", [ "label" => esc_html__( "Sermon Layout", "zegen-core" ), "type" => \Elementor\Controls_Manager::SELECT, "default" => "default", "options" => [ "default" => esc_html__( "Default", "zegen-core" ), "classic" => esc_html__( "Classic", "zegen-core" ), "modern" => esc_html__( "Modern", "zegen-core" ), "list" => esc_html__( "List", "zegen-core" ), ] ] ); $this->add_control( "variation", [ "type" => \Elementor\Controls_Manager::SELECT, "label" => esc_html__( "Sermon Variation", "zegen-core" ), "description" => esc_html__( "This is option for sermon variatoin either dark or light.", "zegen-core" ), "default" => "light", "options" => [ "light" => esc_html__( "Light", "zegen-core" ), "dark" => esc_html__( "Dark", "zegen-core" ) ] ] ); $this->add_control( "sermon_cols", [ "type" => \Elementor\Controls_Manager::SELECT, "label" => esc_html__( "Sermon Columns", "zegen-core" ), "description" => esc_html__( "This is option for sermon columns.", "zegen-core" ), "default" => "6", "options" => [ "3" => esc_html__( "4 Columns", "zegen-core" ), "4" => esc_html__( "3 Columns", "zegen-core" ), "6" => esc_html__( "2 Columns", "zegen-core" ), "12" => esc_html__( "1 Column", "zegen-core" ) ] ] ); $this->add_control( "sermon_items", [ "label" => "Post Items", "description" => esc_html__( "This is settings for sermon custom layout. here you can set your own layout. Drag and drop needed sermon items to Enabled part.", "zegen-core" ), "type" => "dragdrop", "ddvalues" => [ "Enabled" => [ "thumb" => esc_html__( "Feature Image", "zegen-core" ), "name" => esc_html__( "Name", "zegen-core" ), "meta" => esc_html__( "Meta", "zegen-core" ), "excerpt" => esc_html__( "Excerpt", "zegen-core" ), "links" => esc_html__( "Links", "zegen-core" ) ], "disabled" => [ "more" => esc_html__( "Read More", "zegen-core" ) ] ] ] ); $this->add_control( "text_align", [ "type" => \Elementor\Controls_Manager::SELECT, "label" => esc_html__( "Text Align", "zegen-core" ), "description" => esc_html__( "This is option for sermon text align.", "zegen-core" ), "default" => "default", "options" => [ "default" => esc_html__( "Default", "zegen-core" ), "left" => esc_html__( "Left", "zegen-core" ), "center" => esc_html__( "Center", "zegen-core" ), "right" => esc_html__( "Right", "zegen-core" ) ] ] ); $this->end_controls_section(); //Overlay Section $this->start_controls_section( "overlay_section", [ "label" => esc_html__( "Overlay", "zegen-core" ), "tab" => \Elementor\Controls_Manager::TAB_CONTENT, "description" => esc_html__( "Sermon image overlay options here available.", "zegen-core" ), ] ); $this->add_control( "sermon_overlay_opt", [ "label" => esc_html__( "Overlay Sermon Option", "zegen-core" ), "description" => esc_html__( "This is option for enable overlay sermon option.", "zegen-core" ), "type" => "toggleswitch", "default" => "0" ] ); $this->add_control( "sermon_overlay_font_color", [ "type" => \Elementor\Controls_Manager::COLOR, "label" => esc_html__( "Overlay Font Color", "zegen-core" ), "description" => esc_html__( "Here you can put sermon overlay font color.", "zegen-core" ), "default" => "", 'selectors' => [ '{{WRAPPER}} .sermon-wrapper .sermon-overlay' => 'color: {{VALUE}};', ], "condition" => [ "sermon_overlay_opt" => "1" ] ] ); $this->add_control( "sermon_overlay_link_color", [ "type" => \Elementor\Controls_Manager::COLOR, "label" => esc_html__( "Overlay Link Color", "zegen-core" ), "description" => esc_html__( "Here you can put sermon overlay link normal color. Example #ffffff", "zegen-core" ), "default" => "", 'selectors' => [ '{{WRAPPER}} .sermon-wrapper .sermon-overlay a.client-name' => 'color: {{VALUE}};', ], "condition" => [ "sermon_overlay_opt" => "1" ] ] ); $this->add_control( "sermon_overlay_link_hcolor", [ "type" => \Elementor\Controls_Manager::COLOR, "label" => esc_html__( "Overlay Link Hover Color", "zegen-core" ), "description" => esc_html__( "Here you can put sermon overlay link hover color. Example #ffffff", "zegen-core" ), "default" => "", 'selectors' => [ '{{WRAPPER}} .sermon-wrapper .sermon-overlay a.client-name:hover' => 'color: {{VALUE}};', ], "condition" => [ "sermon_overlay_opt" => "1" ] ] ); $this->add_control( "overlay_sermon_items", [ "label" => "Overlay Sermon Items", "description" => esc_html__( "This is settings for sermon items(name, excerpt etc..) overlay on thumbnail. Drag and drop needed sermon items to Enabled part.", "zegen-core" ), "type" => "dragdrop", "ddvalues" => [ "Enabled" => [ "name" => esc_html__( "Name", "zegen-core" ), ], "disabled" => [ "links" => esc_html__( "Links", "zegen-core" ), "meta" => esc_html__( "Meta", "zegen-core" ) ] ], "condition" => [ "sermon_overlay_opt" => "1" ] ] ); $this->add_control( "sermon_overlay_position", [ "type" => \Elementor\Controls_Manager::SELECT, "label" => esc_html__( "Overlay Items Position", "zegen-core" ), "description" => esc_html__( "This is option for overlay items position.", "zegen-core" ), "default" => "bottom-left", "options" => [ "center" => esc_html__( "Center", "zegen-core" ), "top-left" => esc_html__( "Top Left", "zegen-core" ), "top-right" => esc_html__( "Top Right", "zegen-core" ), "bottom-left" => esc_html__( "Bottom Left", "zegen-core" ), "bottom-right" => esc_html__( "Bottom Right", "zegen-core" ) ], "condition" => [ "sermon_overlay_opt" => "1" ] ] ); $this->add_control( "overlay_text_align", [ "type" => \Elementor\Controls_Manager::SELECT, "label" => esc_html__( "Overlay Text Align", "zegen-core" ), "description" => esc_html__( "This is option for overlay sermon text align.", "zegen-core" ), "default" => "default", "options" => [ "default" => esc_html__( "Default", "zegen-core" ), "left" => esc_html__( "Left", "zegen-core" ), "center" => esc_html__( "Center", "zegen-core" ), "right" => esc_html__( "Right", "zegen-core" ) ], "condition" => [ "sermon_overlay_opt" => "1" ] ] ); $this->add_control( "sermon_overlay_type", [ "type" => \Elementor\Controls_Manager::SELECT, "label" => esc_html__( "Overlay Type", "zegen-core" ), "description" => esc_html__( "This is option for sermon overlay type.", "zegen-core" ), "default" => "none", "options" => [ "none" => esc_html__( "None", "zegen-core" ), "dark" => esc_html__( "Overlay Dark", "zegen-core" ), "light" => esc_html__( "Overlay White", "zegen-core" ), "custom" => esc_html__( "Custom Color", "zegen-core" ) ], "condition" => [ "sermon_overlay_opt" => "1" ] ] ); $this->add_control( "sermon_overlay_custom_color", [ "type" => \Elementor\Controls_Manager::COLOR, "label" => esc_html__( "Overlay Custom Color", "zegen-core" ), "description" => esc_html__( "Here you can put sermon overlay custom color.", "zegen-core" ), "default" => "", 'selectors' => [ '{{WRAPPER}} .sermon-wrapper .sermon-thumb .overlay-custom' => 'background: {{VALUE}};', ], "condition" => [ "sermon_overlay_type" => "custom" ] ] ); $this->end_controls_section(); //Image Section $this->start_controls_section( "image_section", [ "label" => esc_html__( "Image", "zegen-core" ), "tab" => \Elementor\Controls_Manager::TAB_CONTENT, "description" => esc_html__( "Image options here available.", "zegen-core" ), ] ); $this->add_control( "image_size", [ "type" => \Elementor\Controls_Manager::SELECT, "label" => esc_html__( "Image Size", "zegen-core" ), 'description' => esc_html__( 'Choose thumbnail size for display different size image.', 'zegen-core' ), "default" => "large", "options" => [ "large" => esc_html__( "Large", "zegen-core" ), "medium" => esc_html__( "Medium", "zegen-core" ), "thumbnail" => esc_html__( "Thumbnail", "zegen-core" ), "custom" => esc_html__( "Custom", "zegen-core" ) ] ] ); $this->add_control( "custom_image_size", [ "type" => \Elementor\Controls_Manager::TEXT, "label" => esc_html__( "Custom Image Size", "zegen-core" ), "description" => esc_html__( "Enter custom image size. You must specify the semi colon(;) at last then only it'll crop. eg: 200x200;", "zegen-core" ), "default" => "", "condition" => [ "image_size" => "custom" ] ] ); $this->add_control( "hard_croping", [ "label" => esc_html__( "Image Hard Crop", "zegen-core" ), "type" => "toggleswitch", "default" => "0", "condition" => [ "image_size" => "custom" ] ] ); $this->add_control( "image_shape", [ "type" => \Elementor\Controls_Manager::SELECT, "label" => esc_html__( "Image Shape", "zegen-core" ), 'description' => esc_html__( 'Choose sermon image shape. Like rounded, circle, etc..', 'zegen-core' ), "default" => "", "options" => [ "" => esc_html__( "Default", "zegen-core" ), "rounded" => esc_html__( "Rounded", "zegen-core" ), "rounded-circle" => esc_html__( "Circle", "zegen-core" ), "img-thumbnail" => esc_html__( "Thumbnail", "zegen-core" ), "rounded img-thumbnail" => esc_html__( "Rounded Thumbnail", "zegen-core" ), "rounded-circle img-thumbnail" => esc_html__( "Circle Thumbnail", "zegen-core" ) ] ] ); $this->end_controls_section(); //Slide Section $this->start_controls_section( "slide_section", [ "label" => esc_html__( "Slide", "zegen-core" ), "tab" => \Elementor\Controls_Manager::TAB_CONTENT, "description" => esc_html__( "Sermon slide options here available.", "zegen-core" ), ] ); $this->add_control( "slide_opt", [ "label" => esc_html__( "Slide Option", "zegen-core" ), "description" => esc_html__( "This is option for sermon slider option.", "zegen-core" ), "type" => "toggleswitch", "default" => "0" ] ); $this->add_control( "slide_item", [ "type" => \Elementor\Controls_Manager::TEXT, "label" => esc_html__( "Slide Items", "zegen-core" ), "description" => esc_html__( "This is option for sermon slide items shown on large devices.", "zegen-core" ), "default" => "2", ] ); $this->add_control( "slide_item_tab", [ "type" => \Elementor\Controls_Manager::TEXT, "label" => esc_html__( "Items on Tab", "zegen-core" ), "description" => esc_html__( "This is option for sermon slide items shown on tab.", "zegen-core" ), "default" => "2", ] ); $this->add_control( "slide_item_mobile", [ "type" => \Elementor\Controls_Manager::TEXT, "label" => esc_html__( "Items on Mobile", "zegen-core" ), "description" => esc_html__( "This is option for sermon slide items shown on mobile.", "zegen-core" ), "default" => "1", ] ); $this->add_control( "slide_item_autoplay", [ "label" => esc_html__( "Auto Play", "zegen-core" ), "description" => esc_html__( "This is option for sermon slider auto play.", "zegen-core" ), "type" => "toggleswitch", "default" => "0" ] ); $this->add_control( "slide_item_loop", [ "label" => esc_html__( "Loop", "zegen-core" ), "description" => esc_html__( "This is option for sermon slider loop.", "zegen-core" ), "type" => "toggleswitch", "default" => "0" ] ); $this->add_control( "slide_center", [ "label" => esc_html__( "Items Center", "zegen-core" ), "description" => esc_html__( "This is option for sermon slider center, for this option must active loop and minimum items 2.", "zegen-core" ), "type" => "toggleswitch", "default" => "0" ] ); $this->add_control( "slide_nav", [ "label" => esc_html__( "Navigation", "zegen-core" ), "description" => esc_html__( "This is option for sermon slider navigation.", "zegen-core" ), "type" => "toggleswitch", "default" => "0" ] ); $this->add_control( "slide_dots", [ "label" => esc_html__( "Pagination", "zegen-core" ), "description" => esc_html__( "This is option for sermon slider pagination.", "zegen-core" ), "type" => "toggleswitch", "default" => "0" ] ); $this->add_control( "slide_margin", [ "type" => \Elementor\Controls_Manager::TEXT, "label" => esc_html__( "Items Margin", "zegen-core" ), "description" => esc_html__( "This is option for sermon slider margin space.", "zegen-core" ), "default" => "", ] ); $this->add_control( "slide_duration", [ "type" => \Elementor\Controls_Manager::TEXT, "label" => esc_html__( "Items Duration", "zegen-core" ), "description" => esc_html__( "This is option for sermon slider duration.", "zegen-core" ), "default" => "5000", ] ); $this->add_control( "slide_smart_speed", [ "type" => \Elementor\Controls_Manager::TEXT, "label" => esc_html__( "Items Smart Speed", "zegen-core" ), "description" => esc_html__( "This is option for sermon slider smart speed.", "zegen-core" ), "default" => "250", ] ); $this->add_control( "slide_slideby", [ "type" => \Elementor\Controls_Manager::TEXT, "label" => esc_html__( "Items Slideby", "zegen-core" ), "description" => esc_html__( "This is option for sermon slider scroll by.", "zegen-core" ), "default" => "1", ] ); $this->end_controls_section(); //Spacing Section $this->start_controls_section( "spacing_section", [ "label" => esc_html__( "Spacing", "zegen-core" ), "tab" => \Elementor\Controls_Manager::TAB_CONTENT, "description" => esc_html__( "Each item bottom space options here available.", "zegen-core" ), ] ); $this->add_control( "sc_spacing", [ "type" => 'itemspacing', "label" => esc_html__( "Items Spacing", "zegen-core" ), "description" => esc_html__( "Here you can mention each sermon items bottom space if you want to set default space of any item just use hyphen(-). Example 10px 20px - 10px", "zegen-core" ), "default" => "" ] ); $this->end_controls_section(); } /** * Render Animated Text 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(); extract( $settings ); $output = ''; //Defined Variable $class_names = isset( $extra_class ) && $extra_class != '' ? ' ' . $extra_class : ''; $post_per_page = isset( $post_per_page ) && $post_per_page != '' ? $post_per_page : ''; $excerpt_length = isset( $excerpt_length ) && $excerpt_length != '' ? $excerpt_length : 0; $this->excerpt_len = $excerpt_length; $class_names .= isset( $sermon_layout ) ? ' sermon-' . $sermon_layout : ' sermon-1'; $class_names .= isset( $text_align ) && $text_align != 'default' ? ' text-' . $text_align : ''; $sermon_layout = isset( $sermon_layout ) ? $sermon_layout : ''; $class_names .= isset( $variation ) ? ' sermon-' . $variation : ''; $cols = isset( $sermon_cols ) ? $sermon_cols : 12; $more_text = isset( $more_text ) && $more_text != '' ? $more_text : ''; $slide_opt = isset( $slide_opt ) && $slide_opt == '1' ? true : false; $sermon_overlay_opt = isset( $sermon_overlay_opt ) && $sermon_overlay_opt == '1' ? true : false; $sermon_overlay_type = isset( $sermon_overlay_type ) ? $sermon_overlay_type : 'none'; $heading_tag = isset( $heading_tag ) ? $heading_tag : 'h3'; $list_layout = isset( $sermon_layout ) && $sermon_layout == 'list' ? 1 : 0; $image_shape = isset( $image_shape ) && $image_shape != '' ? $image_shape : ''; $sermon_cats = isset( $sermon_cats ) && $sermon_cats != '' ? $sermon_cats : ''; $sermon_preachers = isset( $sermon_preachers ) && $sermon_preachers != '' ? $sermon_preachers : ''; $sermon_ids = isset( $sermon_ids ) && $sermon_ids != '' ? $sermon_ids : ''; $pagination = isset( $pagination ) && $pagination == '1' ? true : false; $order_by = ''; $inc_cat_array = ''; if( $sermon_cats ){ //Cats In $cats_in = array(); $filter = preg_replace( '/\s+/', '', $sermon_cats ); $filter = explode( ',', rtrim( $filter, ',' ) ); foreach( $filter as $cat ){ $cat_term = get_term_by( 'id', $cat, 'sermon-categories' ); //post in array push if( isset( $cat_term->term_id ) ) array_push( $cats_in, absint( $cat_term->term_id ) ); } $inc_cat_array = $cats_in ? array( 'taxonomy' => 'sermon-categories', 'field' => 'id', 'terms' => $cats_in ) : ''; } $inc_preacher_array = ''; if( $sermon_preachers ){ //preacher In $preacher_in = array(); $filter = preg_replace( '/\s+/', '', $sermon_preachers ); $filter = explode( ',', rtrim( $filter, ',' ) ); foreach( $filter as $preacher ){ $preacher_term = get_term_by( 'id', $preacher, 'sermon-preacher' ); //post in array push if( isset( $preacher_term->term_id ) ) array_push( $preacher_in, absint( $preacher_term->term_id ) ); } $inc_preacher_array = $preacher_in ? array( 'taxonomy' => 'sermon-preacher', 'field' => 'id', 'terms' => $preacher_in ) : ''; } if( $sermon_ids ){ $sermon_ids = preg_replace( '/\s+/', '', $sermon_ids ); $sermon_ids = explode( ',', rtrim( $sermon_ids, ',' ) ); $order_by = 'post__in'; } $sclass_name = isset( $social_style ) && !empty( $social_style ) ? ' social-' . $social_style : ''; $sclass_name .= isset( $social_color ) && !empty( $social_color ) ? ' social-' . $social_color : ''; $sclass_name .= isset( $social_hcolor ) && !empty( $social_hcolor ) ? ' social-' . $social_hcolor : ''; $sclass_name .= isset( $social_bg ) && !empty( $social_bg ) ? ' social-' . $social_bg : ''; $sclass_name .= isset( $social_hbg ) && !empty( $social_hbg ) ? ' social-' . $social_hbg : ''; $overlay_class = ''; $overlay_class .= isset( $sermon_overlay_position ) ? ' overlay-'.$sermon_overlay_position : ' overlay-center'; $thumb_size = isset( $image_size ) ? $image_size : ''; $cus_thumb_size = ''; $hard_crop = false; if( $thumb_size == 'custom' ){ $cus_thumb_size = isset( $custom_image_size ) && $custom_image_size != '' ? $custom_image_size : ''; $hard_crop = isset( $hard_croping ) && $hard_croping == '1' ? true : false; } $default_items = array( 'thumb' => esc_html__( 'Image', 'zegen-core' ), 'name' => esc_html__( 'Name', 'zegen-core' ), 'designation' => esc_html__( 'Designation', 'zegen-core' ), 'excerpt' => esc_html__( 'Excerpt', 'zegen-core' ), 'social' => esc_html__( 'Social Links', 'zegen-core' ) ); $default_overlay_items = array( 'name' => esc_html__( 'Name', 'zegen-core' ) ); $elemetns = isset( $sermon_items ) && !empty( $sermon_items ) ? json_decode( $sermon_items, true ) : array( 'Enabled' => $default_items ); $overlay_elemetns = isset( $overlay_sermon_items ) && !empty( $overlay_sermon_items ) ? json_decode( $overlay_sermon_items, true ) : array( 'Enabled' => $default_overlay_items ); // This is custom css options for main shortcode warpper $shortcode_css = ''; $shortcode_rand_id = $rand_class = 'shortcode-rand-'. zegen_shortcode_rand_id(); //Spacing if( isset( $sc_spacing ) && !empty( $sc_spacing ) ){ $sc_spacing = preg_replace( '!\s+!', ' ', $sc_spacing ); $space_arr = explode( " ", $sc_spacing ); $i = 1; if( !$list_layout ){ $space_class_name = '.' . esc_attr( $rand_class ) . '.sermon-wrapper .sermon-inner >'; }else{ $space_class_name = '.' . esc_attr( $rand_class ) . '.sermon-wrapper .sermon-list-item .media-body >'; } foreach( $space_arr as $space ){ $shortcode_css .= $space != '-' ? $space_class_name .' *:nth-child('. esc_attr( $i ) .') { margin-bottom: '. esc_attr( $space ) .'; }' : ''; $i++; } } $gal_atts = ''; if( $slide_opt ){ $gal_atts = array( 'data-loop="'. ( isset( $slide_item_loop ) && $slide_item_loop == '1' ? 1 : 0 ) .'"', 'data-margin="'. ( isset( $slide_margin ) && $slide_margin != '' ? absint( $slide_margin ) : 0 ) .'"', 'data-center="'. ( isset( $slide_center ) && $slide_center == '1' ? 1 : 0 ) .'"', 'data-nav="'. ( isset( $slide_nav ) && $slide_nav == '1' ? 1 : 0 ) .'"', 'data-dots="'. ( isset( $slide_dots ) && $slide_dots == '1' ? 1 : 0 ) .'"', 'data-autoplay="'. ( isset( $slide_item_autoplay ) && $slide_item_autoplay == '1' ? 1 : 0 ) .'"', 'data-items="'. ( isset( $slide_item ) && $slide_item != '' ? absint( $slide_item ) : 1 ) .'"', 'data-items-tab="'. ( isset( $slide_item_tab ) && $slide_item_tab != '' ? absint( $slide_item_tab ) : 1 ) .'"', 'data-items-mob="'. ( isset( $slide_item_mobile ) && $slide_item_mobile != '' ? absint( $slide_item_mobile ) : 1 ) .'"', 'data-duration="'. ( isset( $slide_duration ) && $slide_duration != '' ? absint( $slide_duration ) : 5000 ) .'"', 'data-smartspeed="'. ( isset( $slide_smart_speed ) && $slide_smart_speed != '' ? absint( $slide_smart_speed ) : 250 ) .'"', 'data-scrollby="'. ( isset( $slide_slideby ) && $slide_slideby != '' ? absint( $slide_slideby ) : 1 ) .'"', 'data-autoheight="false"', ); $data_atts = implode( " ", $gal_atts ); } $paged = 1; if( get_query_var( 'paged' ) ) $paged = get_query_var( 'paged' ); elseif( get_query_var( 'page' ) ) $paged = get_query_var( 'page' ); $args = array( 'post_type' => 'zegen-sermon', 'posts_per_page' => absint( $post_per_page ), 'ignore_sticky_posts' => 1, 'post__in' => $sermon_ids, 'orderby' => $order_by, 'paged' => $paged, 'tax_query' => array( 'relation' => 'AND', $inc_cat_array, $inc_preacher_array ) ); $query = new WP_Query( $args ); if ( $query->have_posts() ) { $sermon_array = array( 'thumb_size' => $thumb_size, 'cus_thumb_size' => $cus_thumb_size, 'hard_crop' => $hard_crop, 'excerpt_length' => $excerpt_length, 'cols' => $cols, 'more_text' => $more_text, 'social_class' => $sclass_name, 'post_heading' => $heading_tag, 'sermon_layout' => $sermon_layout, 'image_shape' => $image_shape ); if( $shortcode_css ) $class_names .= ' ' . $shortcode_rand_id . ' zegen-inline-css'; echo '
'; $row_stat = 0; if( !$list_layout ){ //Sermon Slide if( $slide_opt ) echo ''; // Unexpected row close } //Sermon Slide End if( $slide_opt ) echo '
'; }else{ if( isset( $elemetns['Enabled']['thumb'] ) ) unset( $elemetns['Enabled']['thumb'] ); //Sermon Slide if( $slide_opt ) echo ''; // Unexpected row close } //Sermon Slide End if( $slide_opt ) echo ''; } if( $pagination ){ require_once ZEGEN_CORE_DIR . 'elementor-supports/inc/zegen-class.php'; $zegen_ele = new CEAPostElements; echo $zegen_ele->zegenWpBootstrapPagination( $args, $query->max_num_pages, false ); } echo ''; }// query exists // use reset postdata to restore orginal query wp_reset_postdata(); } function zegen_sermon_shortcode_elements( $element, $opts = array() ){ $sermon_id = $opts['post_id']; $output = ''; switch( $element ){ case "name": $head = isset( $opts['post_heading'] ) ? $opts['post_heading'] : 'h3'; $output .= '
'; $output .= '<' . esc_attr( $head ) . '>'. esc_html( get_the_title() ) .''; $output .= '
'; break; case "thumb": if ( has_post_thumbnail() ) { // Custom Thumb Code $thumb_size = $thumb_cond = $opts['thumb_size']; $cus_thumb_size = $opts['cus_thumb_size']; $hard_crop = $opts['hard_crop']; $custom_opt = $img_prop = ''; if( $thumb_cond == 'custom' ){ if( strpos( $cus_thumb_size, ";" ) ){ $custom_opt = $cus_thumb_size != '' ? explode( "x", str_replace( ";", "", $cus_thumb_size ) ) : array(); $img_prop = zegen_get_custom_size_image( $custom_opt, $hard_crop ); $thumb_size = array( $img_prop[1], $img_prop[2] ); }else{ $thumb_size = 'large'; $thumb_cond = ''; } }// Custom Thumb Code End $output .= '
'; $output .= isset( $opts['overlay'] ) ? $opts['overlay'] : ''; $img_class = 'img-fluid'; $img_class .= isset( $opts['image_shape'] ) ? ' '. $opts['image_shape'] : ''; if( $thumb_cond == 'custom' ){ $output .= ''. esc_attr( get_the_title() ) .''; }else{ $output .= get_the_post_thumbnail( $sermon_id, $thumb_size, array( 'class' => 'img-fluid' ) ); } $output .= '
'; } break; case "excerpt": $excerpt = isset( $opts['excerpt_length'] ) && $opts['excerpt_length'] != '' ? $opts['excerpt_length'] : 20; $output .= '
'; add_filter( 'excerpt_more', 'zegen_excerpt_more' ); add_filter( 'excerpt_length', array( &$this, 'zegen_excerpt_length' ) ); ob_start(); the_excerpt(); $excerpt_cont = ob_get_clean(); $output .= $excerpt_cont; $output .= '
'; break; case "more": $read_more_text = isset( $opts['more_text'] ) ? $opts['more_text'] : esc_html__( 'Read more', 'zegen-core' ); $output = '
'. esc_html( $read_more_text ) .'
'; break; case "links": $output .= ''; break; case "meta": $output .= ''; break; } return $output; } function zegen_excerpt_length( $length ) { return $this->excerpt_len; } function zegen_allowed_tags(){ $allowed_atts = array( 'href' => array(), 'class' => array() ); $allowedtags['a'] = $allowed_atts; $allowedtags['span'] = $allowed_atts; return $allowedtags; }}