File: /datos/www/www.colombia.co/public_html/wp-content/themes/colombia2016/category-embajadores.php
<?php get_header(); ?>
<?php
global $wp_query, $paged;
$cat = get_cat_ID(single_cat_title('', false));
$cat_id = get_cat_ID(single_cat_title('', false));
$real_id = get_cat_ID($cat_id);
$category = get_the_category();
$parent = get_cat_name($category[0]->category_parent);
// Acá definimos $subtitulo, $category_color y $category_image para usarlos donde sea necesario
$images = get_option('taxonomy_image_plugin'); // get the taxonomy images array
if( array_key_exists( $cat_id, $images ) ) { // check if term has an image
$category_image = wp_get_attachment_image_src( $images[$cat_id], 'full' ); // if it does, echo that image
}
$category_color = get_term_meta( $cat_id , 'category_color', true );
$subtitulo = get_term_meta( $cat_id , 'category_subtitle', true );
?>
<main class="embajadores-in">
<div id="category-header" style="background-image:url('<?php echo $category_image[0]; ?>')"">
<div class="l-container l-flex">
<?php
$cat_desc = category_description(get_cat_ID(single_cat_title('', false)));
?>
<div class="cat-header-container">
<h2 class="cat-name"><?php echo $parent; ?></h2>
<h1 class="cat-title"><?php single_cat_title(); ?></h1>
<?php
if( $cat_desc ){
?>
<div class="cat-description"><?php echo $cat_desc; ?></div>
<?php } ?>
</div>
</div>
</div>
<section>
<div id="content-wrapper" class="l-container l-flex">
<div class="content-box">
<section id="posts" class="l-flex country_brand">
<?php while ( have_posts() ) : the_post(); ?>
<?php
$url_exploded = explode('/', parse_url(get_the_permalink(), PHP_URL_PATH));
$parent_category = 'category-'.$url_exploded[1];
?>
<article class="category- post type-post status-publish category-actualidad format-standard has-post-thumbnail hentry category-regiones-del-pais category-turismo category-turismo-por-regiones tag-colombia tag-regiones-de-colombia tag-turismo tag-viajes" >
<figure class="post-img">
<a href="<?php the_permalink(); ?>">
<?php
$thumb = get_field('thumb_post');
if(!empty($thumb)){
?>
<img class="attachment-post-thumbnail size-post-thumbnail wp-post-image" src="<?php echo $thumb['sizes']['medium']; ?>" alt="<?php echo $thumb['alt']; ?>" title="<?php echo $thumb['title']; ?>" />
<?php } ?>
</a>
</figure>
<div class="post-category">
<?php if(get_field( "profession")){?>
<ul class="post-categories">
<li><a href="<?php the_permalink(); ?>"><?php echo get_field( "profession"); ?></a></li>
</ul>
<?php } ?>
</div>
<div class="post-title">
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
</div>
<a href="<?php the_permalink(); ?>">
<div class="post-excerpt">
<div class="excerpt-wrapper">
<?php the_excerpt(); ?>
<span class="read-more"><i class="icon-read-more"></i><br>Ver más</span>
</div>
</div>
</a>
</article>
<?php endwhile; ?>
<?php if($wp_query->max_num_pages > 1){ ?>
<div id="pagination">
<button id="load-more" class="btn-secondary" type="button" data-current-page="<?php echo $paged; ?>" data-total-pages="<?php echo $wp_query->max_num_pages; ?>">Cargar más</button>
</div>
<?php } ?>
</section>
</div>
<?php
get_sidebar();
?>
</div>
</section>
</main>
<?php get_footer(); ?>