D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
proc
/
self
/
cwd
/
wp-content
/
plugins
/
aeen-core
/
elementor
/
case-studies
/
Filename :
view-2.php
back
Copy
<?php /** * This file can be overridden by copying it to yourtheme/elementor-custom/title/view.php * * @author RadiusTheme * @since 1.0 * @version 1.0 */ namespace radiustheme\Aeen_Core; use radiustheme\aeen\inc\Helper; extract( $data ); $prefix = AEEN_CORE_CPT; $cpt = AEEN_CORE_CPT; $thumb_size = $prefix .'-size-team2'; $args = array( 'post_type' => "{$cpt}_case_study", 'posts_per_page' => $data['number'], 'suppress_filters' => false, 'orderby' => $data['orderby'], ); switch ( $data['orderby'] ) { case 'title': case 'menu_order': $args['order'] = 'ASC'; break; } $bool = isset( $data['category_list'] ); $bool = $bool && is_array( $data['category_list'] ); $bool = $bool && count( $data['category_list'] ) ; if ( $bool ) { $args['tax_query'] = array( array( 'taxonomy' => "{$prefix}_case_study_category", 'terms' => $data['category_list'], // Where term_id of Term 1 is "1". 'include_children' => false ) ); } $posts = get_posts( $args ); $uniqueid = time() . rand( 1, 99 ); $project = array(); $cats = array(); foreach ( $posts as $post ) { $cats_comma = array(); $img = get_post_thumbnail_id( $post ); $terms = get_the_terms( $post, "{$cpt}_case_study_category" ); $terms = $terms ? $terms : array(); $image_id = get_post_thumbnail_id($post); $terms_html = ''; $terms_comma_html = ''; if ( !$terms ) { continue; } foreach ( $terms as $term ) { $terms_html .= " {$uniqueid}-{$term->slug}"; $cats_comma[] = $term->name; if ( !isset( $cats[$term->slug] ) ) { $cats[$term->slug] = $term->name; } } $project[] = array( 'img' => $img, 'alt' => Helper::aeen_get_attachment_alt( $image_id ), 'title' => $post->post_title, 'url' => get_the_permalink( $post ), 'cats' => $terms_html, 'cats_comma' => implode(", ", $cats_comma ), 'postID' => $post->ID, ); } $col_class = "col-lg-{$data['col_lg']} col-md-{$data['col_md']} col-sm-{$data['col_sm']} col-{$data['col_xs']}"; ?> <section class="case-study-wrap-layout2"> <div class="container"> <div class="row"> <?php foreach ( $project as $project_each ): $img = wp_get_attachment_image( $project_each['img'], $thumb_size ); ?> <div class="<?php echo esc_attr( $col_class ); ?> wow animated fadeInUp" data-wow-delay="0.2s"> <div class="case-study-box-layout2"> <div class="item-figure"> <a data-tilt href="<?php echo esc_url( $project_each['url'] );?>"> <?php echo wp_kses_post( $img ); ?> </a> </div> <div class="item-content"> <h3 class="item-title"><a href="<?php echo esc_url( $project_each['url'] );?>"><?php echo esc_html( $project_each['title'] );?></a></h3> <?php if( $category_display == 'yes'){ ?> <div class="item-sub-title"><?php echo Helper::get_case_study_cat( $project_each['postID'] ); ?></div> <?php } ?> </div> </div> </div> <?php endforeach; ?> </div> </div> </section>