'apg', 'posts_per_page' => -1 ]; if(isset($atts['exclude'])){ $exclude_posts = explode(',',$atts['exclude']); $args['post__not_in'] = $exclude_posts; } if(isset($atts['only'])){ $include_posts = explode(',',$atts['only']); $args['post__in'] = $include_posts; } $query = new WP_Query($args); ob_start(); if(isset($atts['type']) && $atts['type'] == 'slider'): $autoplay = 'true'; $show_dots = 'true'; $show_arrows = 'true'; $slides_to_scroll = '1'; $slides_to_show = '3'; if( $atts && !empty( $atts)){ extract($atts); } $set = '"infinite":true,"autoplay":'.$autoplay.',"dots":'.$show_dots.',"arrows":'.$show_arrows.',"slidesToScroll":'.$slides_to_scroll.',"slidesToShow":'.$slides_to_show; $set .= ',"responsive":[{ "breakpoint": 768, "settings": { "slidesToShow": 1, "slidesToScroll": 1 } }]'; ?>
'; $content = ob_get_contents(); ob_end_clean(); return $content; } function apg_gallery_album( $atts = []) { $size = 'apg_cover_image'; if( ! isset($atts['id'])){ return 'Please pass ID'; } if(isset($atts['img_size'])){ $size = $atts['img_size']; } $photos = get_post_meta( intval($atts['id']) , 'apg_gallery' , true ); if( ! $photos || ! is_array($photos)){ return 'No photos has been added.'; } $id = intval( $atts['id'] ); $layout = get_post_meta($id,'apg_layout',true); if(isset($atts['layout'])){ $layout = $atts['layout']; } return $this->get_single_album_view( $id , $layout , $size ,$atts ); } function modal_html() { aswin_photo_gallery()->get_template( 'modal'); } function get_single_album_view( $id , $layout , $size , $atts=[]){ ob_start(); if($layout == 'slider'): $settings = get_post_meta( $id, 'apg_album_setting',true ); aswin_photo_gallery()->get_template('album/slider',[ 'id' => $id, 'settings' => $settings, 'class' => $layout.'-'.$id, 'atts' => $atts ]); elseif($layout == 'slider_multi'): $settings = get_post_meta( $id, 'apg_album_setting',true ); aswin_photo_gallery()->get_template('album/slider-multi',[ 'id' => $id, 'settings' => $settings, 'class' => $layout.'-'.$id, 'atts' => $atts ]); elseif($layout == 'grid'): echo '