cURL Error: 0
<?php
/**
* Template Name: Cases Index
*
*/
?>
<?php get_header(); ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php osetin_output_breadcrumbs(); ?>
<?php
if(has_post_thumbnail()){
$page_bg_image_url = wp_get_attachment_url( get_post_thumbnail_id() ); ?>
<div class="os-container">
<div class="page-intro-header with-background" style="<?php echo osetin_get_css_prop('background-image', $page_bg_image_url, false, 'background-repeat: repeat; background-position: top left; '); ?>">
<h1><?php the_title(); ?></h1>
</div>
</div>
<?php
}
?>
<div class="os-container">
<div class="page-w">
<div class="page-content">
<article id="page-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php
if(!has_post_thumbnail()){
echo '<h1 class="page-title">'.get_the_title().'</h1>';
}
?>
<?php $sub_title = osetin_get_field('sub_title');
if ( ! empty( $sub_title ) ) { ?>
<h5 class="page-content-sub-title"><?php echo esc_html($sub_title); ?></h5>
<?php } ?>
<?php if($post->post_content != ''){ ?>
<div class="page-content-text"><?php the_content(); ?></div>
<?php } ?>
<div class="category-tiles case-tiles columns-<?php echo osetin_get_field('number_of_columns', get_the_ID(), 'three'); ?>">
<?php
$args = array(
'orderby' => 'date',
'order' => 'DESC',
'posts_per_page' => -1,
'paged' => 1,
'post_type' => 'osetin_case'
);
$selected_cases = osetin_get_field('show_selected_cases', get_the_ID(), false, true);
if($selected_cases){
$args['post__in'] = $selected_cases;
}
$osetin_query = new WP_Query( $args );
if ( $osetin_query->have_posts() ) {
while ( $osetin_query->have_posts() ) : $osetin_query->the_post();
$terms = get_the_terms(get_the_ID(), 'case_category');
if($terms){
$term_name = $terms[0]->name;
}else{
$term_name = false;
}
?>
<a href="<?php echo the_permalink(); ?>" class="category-tile" style="<?php echo osetin_get_css_prop('background-image', get_the_post_thumbnail_url(get_the_ID(), 'large'), false, 'background-repeat: repeat; background-position: center center; background-size: cover;'); ?>">
<span class="category-fader"></span>
<span class="category-content">
<span class="category-title"><?php the_title(); ?></span>
<?php if($term_name){ ?>
<span class="category-recipes-count"><?php echo esc_html($term_name); ?></span>
<?php } ?>
</span>
</a>
<?php
endwhile;
}
wp_reset_postdata(); ?>
</div>
</article>
</div>
</div>
</div>
<?php
endwhile; endif; ?>
<?php get_footer(); ?>