_meta( $id ,'_portfolio_custom_link', true ) != '' ? get_post_meta( $id , '_portfolio_custom_link_url', true ) : get_permalink( $id ); //merge default and params array. remove empty params with array_filter $params = array_merge( $defaults, array_filter( $params ) ); $params = apply_filters( 'avf_portfolio_preview_template_params', $params, $entry ); global $avia_config; /** * Fullwidth shortcodes like "Fullwidth Button" will break layout because they create an own section. * This allows to return without creating new sections * * @since 4.7.6.4 */ if( ! isset( $avia_config['portfolio_preview_template'] ) ) { $avia_config['portfolio_preview_template'] = 0; } $avia_config['portfolio_preview_template'] ++; //set the content $content = str_replace( ']]>', ']]>', apply_filters( 'the_content', $params['text'] ) ); unset( $params['text'] ); if( isset( $avia_config['portfolio_preview_template'] ) ) { $avia_config['portfolio_preview_template'] --; if( $avia_config['portfolio_preview_template'] <= 0 ) { unset( $avia_config['portfolio_preview_template'] ); } } //set images $string = ''; //set first class if preview images are deactivated $nogalleryclass = ''; $params['ajax_request'] = true; switch( $params['method'] ) { case 'gallery': $params['style'] = 'big_thumb'; $params['thumb_size'] = 'square'; foreach( $params as $key => $param ) { $string .= $key . "='" . $param . "' "; } $images = do_shortcode( "[av_gallery {$string}]" ); break; case 'slideshow': $params['size'] = $params['preview_size']; foreach( $params as $key => $param ) { $string .= $key . "='" . $param . "' "; } $images = do_shortcode( "[av_slideshow {$string}]" ); break; case 'list': $images = $this->post_images( $params['ids'] ); break; case 'no': $images = false; $nogalleryclass = ' no_portfolio_preview_gallery '; break; } $output .= "
"; $output .= "
'entry', 'echo' => false, 'id' => $id, 'custom_markup' => $this->atts['custom_markup'] ) ) . ">"; if( ! empty( $images ) ) { $output .= "
"; $output .= $images; $output .= '
'; } if( ! empty( $nogalleryclass ) ) { $nogalleryclass .= ' first '; } $markup = avia_markup_helper( array( 'context' => 'entry_title', 'echo' => false, 'id' => $id, 'custom_markup' => $this->atts['custom_markup'] ) ); $default_heading = 'h2'; $args = array( 'heading' => $default_heading, 'extra_class' => '' ); $extra_args = array( $this, $entry, __METHOD__ ); /** * @since 4.5.5 * @return array */ $args = apply_filters( 'avf_customize_heading_settings', $args, __CLASS__, $extra_args ); $heading = ! empty( $args['heading'] ) ? $args['heading'] : $default_heading; $css = ! empty( $args['extra_class'] ) ? $args['extra_class'] : ''; $output .= "
"; $output .= '
'; $output .= "<{$heading} class='portfolio-preview-title entry-title {$css}' {$markup}>" . avia_wp_get_the_title( $entry ) . ""; $output .= '
'; $output .= "
'entry_content', 'echo' => false, 'id' => $id, 'custom_markup' => $this->atts['custom_markup'] ) ) . ">"; $output .= $content; $output .= '
'; $output .= ""; $output .= '
'; $output .= ''; $output .= '
'; $output .= '
'; return "\n\n"; } /** * * @param string $ids * @return string */ protected function post_images( $ids ) { if( empty( $ids ) ) { return; } $attachments = get_posts( array( 'include' => $ids, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'post__in' ) ); $output = ''; foreach( $attachments as $attachment ) { // create array with responsive info for lightbox $img = Av_Responsive_Images()->responsive_image_src( $attachment->ID, 'large' ); $alt = get_post_meta( $attachment->ID, '_wp_attachment_image_alt', true ); $alt = ! empty( $alt ) ? esc_attr( $alt ) : ''; $title = trim( $attachment->post_title ) ? esc_attr( $attachment->post_title ) : ''; $description = trim( $attachment->post_content ) ? esc_attr( $attachment->post_content ) : ''; $img_tag = "{$alt}"; $img_tag = Av_Responsive_Images()->prepare_single_image( $img_tag, $attachment->ID, $this->atts['lazy_loading'] ); $lightbox_attr = Av_Responsive_Images()->html_attr_image_src( $img, false ); $output .= ""; $output .= $img_tag; $output .= ''; } return $output; } /** * Output the preview templates in footer * */ public function print_preview_templates() { foreach( $this->entries->posts as $entry ) { echo $this->build_preview_template( $entry ); } } /** * Get the entries and add to local variable * * @param array $params */ public function query_entries( $params = array() ) { $query = array(); if( empty( $params ) ) { $params = $this->atts; } if( ! empty( $params['categories'] ) ) { //get the portfolio categories $terms = explode( ',', $params['categories'] ); } $this->current_page = ( $params['paginate'] != 'no' ) ? avia_get_current_pagination_number( 'avia-element-paging' ) : 1; $date_query = AviaHelper::date_query( array(), $params ); //if we find categories perform complex query, otherwise simple one if( isset( $terms[0] ) && ! empty( $terms[0] ) && ! is_null( $terms[0] ) && $terms[0] != 'null' ) { $query = array( 'orderby' => $params['query_orderby'], 'order' => $params['query_order'], 'paged' => $this->current_page, 'posts_per_page' => $params['items'], 'post_type' => $params['post_type'], 'date_query' => $date_query, 'tax_query' => array( array( 'taxonomy' => $params['taxonomy'], 'field' => 'id', 'terms' => $terms, 'operator' => 'IN' ) ) ); } else { $query = array( 'orderby' => $params['query_orderby'], 'order' => $params['query_order'], 'paged' => $this->current_page, 'posts_per_page' => $params['items'], 'post_type' => $params['post_type'], 'date_query' => $date_query, ); } /** * * @since < 4.0 * @param array $query * @param array $params * @return array */ $query = apply_filters( 'avia_post_grid_query', $query, $params ); $this->entries = new WP_Query( $query ); } /** * Allows to set the query to an existing post query. usually only needed on pages that already did a query for the entries, like taxonomy archive pages. * Shortcode uses the query_entries function above * */ public function use_global_query() { global $wp_query; $this->entries = $wp_query; } } } /* Example: how to order posts randomly on page load. put this into functions.php add_filter('avia_post_grid_query','avia_order_by_random'); function avia_order_by_random($query) { $query['orderby'] = 'rand'; return $query; } */ 1.0Stichting Collot Zien en Belevenhttps://www.collotzienenbeleven.nlStichting Collot Zien en Belevenhttps://www.collotzienenbeleven.nlOpeningsuren Holland Casino Eindhovenrich600338<blockquote class="wp-embedded-content" data-secret="YWl8by2Fls"><a href="https://www.collotzienenbeleven.nl/openingsuren-holland-casino-eindhoven/">Openingsuren Holland Casino Eindhoven</a></blockquote><iframe sandbox="allow-scripts" security="restricted" src="https://www.collotzienenbeleven.nl/openingsuren-holland-casino-eindhoven/embed/#?secret=YWl8by2Fls" width="600" height="338" title="“Openingsuren Holland Casino Eindhoven” — Stichting Collot Zien en Beleven" data-secret="YWl8by2Fls" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" class="wp-embedded-content"></iframe><script type="text/javascript"> /* <![CDATA[ */ /*! This file is auto-generated */ !function(d,l){"use strict";l.querySelector&&d.addEventListener&&"undefined"!=typeof URL&&(d.wp=d.wp||{},d.wp.receiveEmbedMessage||(d.wp.receiveEmbedMessage=function(e){var t=e.data;if((t||t.secret||t.message||t.value)&&!/[^a-zA-Z0-9]/.test(t.secret)){for(var s,r,n,a=l.querySelectorAll('iframe[data-secret="'+t.secret+'"]'),o=l.querySelectorAll('blockquote[data-secret="'+t.secret+'"]'),c=new RegExp("^https?:$","i"),i=0;i<o.length;i++)o[i].style.display="none";for(i=0;i<a.length;i++)s=a[i],e.source===s.contentWindow&&(s.removeAttribute("style"),"height"===t.message?(1e3<(r=parseInt(t.value,10))?r=1e3:~~r<200&&(r=200),s.height=r):"link"===t.message&&(r=new URL(s.getAttribute("src")),n=new URL(t.value),c.test(n.protocol))&&n.host===r.host&&l.activeElement===s&&(d.top.location.href=t.value))}},d.addEventListener("message",d.wp.receiveEmbedMessage,!1),l.addEventListener("DOMContentLoaded",function(){for(var e,t,s=l.querySelectorAll("iframe.wp-embedded-content"),r=0;r<s.length;r++)(t=(e=s[r]).getAttribute("data-secret"))||(t=Math.random().toString(36).substring(2,12),e.src+="#?secret="+t,e.setAttribute("data-secret",t)),e.contentWindow.postMessage({message:"ready",secret:t},"*")},!1)))}(window,document); /* ]]> */ </script>