HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/ERijn/knijft.eu/wwwroot/wp-content/themes/diverso/portfolio-filterable.php
<div id="portfolio-gallery" class="internal_page_items internal_page_gallery">
    <ul class="gallery-wrap image-grid group">
    <?php    
    global $yiw_portfolio, $paged;
    
    $post_type = yiw_get_portfolio_post_type(); 
    
    $args = array(
        'post_type'      => $post_type,
        'posts_per_page' => -1
    ); 
                    
    if ( is_tax() )   
       $args = wp_parse_args( $args, $wp_query->query ); 
    
    $gallery = new WP_Query( $args );
    
    $postsPerRow = (yiw_layout_page() != 'sidebar-no') ? 3 : 4;
    $i = 0;
    
    while( $gallery->have_posts() ) : $gallery->the_post(); ?>
    
        <?php 
            $classes = "";
            $terms = get_the_terms( get_the_ID(), sanitize_title( $yiw_portfolio[$post_type]['tax'] ) );                         
            
            if(!empty($terms)) {
                foreach( $terms as $index=>$term) {
                    $classes .= " segment-".$index;
                }
            }
            
            $isFirstInRow = ( ++$i==1 | ($i % $postsPerRow) == 1 ) ? 1 : 0;
            $isLastInRow = ( ($i % $postsPerRow) == 0 ) ? 1 : 0;

            if( $thumb = get_post_meta(get_the_ID(), '_portfolio_video', true) ) {
                $class = 'video';
                list( $type, $id ) = explode( ':', yiw_video_type_by_url( $thumb ) );
                if ( $type == 'vimeo' )
                    $thumb .= '?width=500&height=284';
                elseif ( $type == 'youtube' )        
                    $thumb .= '?width=500&height=314';
            } else {
                $thumb = wp_get_attachment_image_src( get_post_thumbnail_id(), 'full' );
                $thumb = $thumb[0];
                $class = 'img';
            }
        ?>

        <li data-id="id-<?php echo $i; ?>" class="<?php if(!empty($terms)) foreach ($terms as $term) { echo strtolower(preg_replace('/\s+/', '-', $term->slug)) . ' '; }  ?>">
        
            <div class="internal_page_item internal_page_item_gallery">
                <?php the_post_thumbnail( 'thumb_gallery', array( 'class' => 'picture' ) ) ?>
                <div class="overlay">                            
                    <h5><a href="<?php the_permalink() ?>"><?php the_title() ?></a></h5>
                    <?php echo yiw_excerpt( 12 ) ?>
                    <a class="icon-zoom" href="<?php echo $thumb ?>" rel="prettyPhoto[gallery]" title="<?php the_title() ?>">Zoom</a>
					<a class="icon-more" href="<?php the_permalink() ?>" title="<?php the_title() ?>"><?php _e( 'View More', 'yiw' ) ?></a>
                </div>
            </div>
            
        </li>
    <?php 
        endwhile; 
        wp_reset_query(); 
    ?>
    </ul>
    <div class="clear"></div>
</div>