Adds table and grid view modes for Terms List. #59.

This commit is contained in:
mateuswetah 2023-02-28 12:19:52 -03:00
parent cc02a94c1c
commit a401a56b0e
10 changed files with 336 additions and 181 deletions

View File

@ -243,7 +243,7 @@
line-height: 0.75rem; line-height: 0.75rem;
} }
.tainacan-list-collection--grid-img { .tainacan-list-collection--grid-img {
width: 275px; width: 250px;
height: 250px; height: 250px;
} }
.image-placeholder { .image-placeholder {

View File

@ -1,31 +1,58 @@
.tainacan-taxonomy-terms-list-container .tainacan-taxonomy-terms-list { .tainacan-taxonomy-terms-list-container .tainacan-taxonomy-terms-list {
display: grid;
grid-template-columns: repeat(auto-fit, 425px);
grid-gap: 30px;
list-style: none; list-style: none;
.term-name { &.tainacan-list-collection--container-card {
font-size: 1.125rem !important; display: grid;
grid-template-columns: repeat(auto-fit, 425px);
grid-gap: 30px;
.term-name {
font-size: 1.125rem !important;
}
.term-description p {
margin-top: 0;
padding-top: 0 !important;
padding-left: 1rem;
}
.term-children-link a {
margin-bottom: 1.5rem;
}
.term-items-link a {
margin-bottom: 1.5rem;
}
.term-thumbnail {
float: left;
margin-bottom: 0;
width: 136px !important;
height: 136px !important;
}
} }
.term-description p { &.tainacan-list-collection--container-grid {
margin-top: 0;
padding-top: 0 !important;
padding-left: 1rem;
}
.term-children-link a { .term-name {
margin-bottom: 1.5rem; margin-bottom: 0.25rem;
} font-size: 1.125rem !important;
}
.term-items-link a { .term-children-link a {
margin-bottom: 1.5rem; margin-bottom: 1.5rem;
} }
.term-thumbnail { .term-items-link a {
float: left; margin-bottom: 1.5rem;
margin-bottom: 0; }
width: 136px !important;
height: 136px !important; .term-thumbnail {
margin-top: 1rem;
margin-bottom: 0rem;
}
} }
} }
.tainacan-taxonomies-pagination-links {
text-align: end;
}

View File

@ -395,37 +395,6 @@ function tainacan_hex2rgb( $color ) {
); );
} }
function tainacan_collections_viewmode( $public_query_vars ) {
$public_query_vars[] = 'tainacan_collections_viewmode';
return $public_query_vars;
}
add_filter( 'query_vars', 'tainacan_collections_viewmode' );
function tainacan_active( $selected, $current = true, $echo = true ) {
$return = $selected == $current ? 'active' : '';
if ( $echo ) {
echo $return;
}
return $return;
}
function tainacan_theme_collection_title( $title ) {
if ( is_post_type_archive( 'tainacan-collection' ) ) {
return __( 'Collections', 'tainacan-interface' );
}
return $title;
}
add_filter( 'get_the_archive_title', 'tainacan_theme_collection_title' );
function tainacan_theme_collection_query( $query ) {
if ( $query->is_main_query() && $query->is_post_type_archive( 'tainacan-collection' ) ) {
$query->set( 'posts_per_page', 12 );
}
}
add_action( 'pre_get_posts', 'tainacan_theme_collection_query' );
/** /**
* Render customizer colors to Gutenberg. * Render customizer colors to Gutenberg.
*/ */
@ -466,5 +435,6 @@ add_action( 'enqueue_block_editor_assets', 'tainacan_editor_styles' );
require get_template_directory() . '/functions/customizer.php'; require get_template_directory() . '/functions/customizer.php';
require get_template_directory() . '/functions/patterns.php'; require get_template_directory() . '/functions/patterns.php';
require get_template_directory() . '/functions/single-functions.php'; require get_template_directory() . '/functions/single-functions.php';
require get_template_directory() . '/functions/archive-functions.php';
require get_template_directory() . '/functions/class-tainacan-interface-collection-settings.php'; require get_template_directory() . '/functions/class-tainacan-interface-collection-settings.php';
require get_template_directory() . '/functions/breadcrumb.php'; require get_template_directory() . '/functions/breadcrumb.php';

View File

@ -0,0 +1,107 @@
<?php
function tainacan_interface_extra_viewmodes( $public_query_vars ) {
$public_query_vars[] = 'tainacan_collections_viewmode';
$public_query_vars[] = 'tainacan_terms_viewmode';
return $public_query_vars;
}
add_filter( 'query_vars', 'tainacan_interface_extra_viewmodes' );
function tainacan_active( $selected, $current = true, $echo = true ) {
$return = $selected == $current ? 'active' : '';
if ( $echo ) {
echo $return;
}
return $return;
}
function tainacan_theme_collection_title( $title ) {
if ( is_post_type_archive( 'tainacan-collection' ) ) {
return __( 'Collections', 'tainacan-interface' );
}
return $title;
}
add_filter( 'get_the_archive_title', 'tainacan_theme_collection_title' );
function tainacan_theme_collection_query( $query ) {
if ( $query->is_main_query() && $query->is_post_type_archive( 'tainacan-collection' ) ) {
$query->set( 'posts_per_page', 12 );
}
}
add_action( 'pre_get_posts', 'tainacan_theme_collection_query' );
/**
* Displays pagination using Tainacan Interface style.
*/
if ( ! function_exists( 'tainacan_pagination' ) ) :
function tainacan_pagination() {
global $wp_query;
$cur_posts = min( (int) $wp_query->get( 'posts_per_page' ), $wp_query->found_posts );
$to_paged = max( (int) $wp_query->get( 'paged' ), 1 );
$count_max = ( $to_paged - 1 ) * $cur_posts; ?>
<div class="d-flex margin-pagination justify-content-between border-top pt-2">
<div class="col-sm-3 d-none d-lg-block pl-0 view-items">
<?php //translators: Example - Viewing results: 1 to 12 of 345 ?>
<?php printf( __('Viewing results: %1$d to %2$d of %3$d', 'tainacan-interface'), $count_max + 1, $count_max + $wp_query->post_count, $wp_query->found_posts ); ?>
</div>
<div class="col-sm-5 pr-md-0 justify-content-md-end">
<?php the_posts_pagination(
array(
'mid_size' => 2,
'prev_text' => sprintf(
'%s',
'<i class="tainacan-icon tainacan-icon-arrowleft tainacan-icon-1-25em"></i>'
),
'next_text' => sprintf(
' %s',
'<i class="tainacan-icon tainacan-icon-arrowright tainacan-icon-1-25em"></i>'
),
'screen_reader_text' => ' '
)
); ?>
</div>
</div>
<?php }
endif;
/**
* Displays pagination for terms list using Tainacan Interface style.
*/
if ( ! function_exists( 'tainacan_pagination_terms' ) ) :
function tainacan_pagination_terms($total_terms) {
$current_args = \Tainacan\Theme_Helper::get_instance()->get_taxonomies_query_args();
$current_total_terms = $total_terms;
$current_first_term_index = max(($current_args['termspaged'] - 1) * $current_args['perpage'] + 1, 1);
$current_last_term_index = min($current_args['termspaged'] * $current_args['perpage'], $current_total_terms);
?>
<div class="d-flex margin-pagination justify-content-between border-top pt-2">
<div class="col-sm-3 d-none d-lg-block pl-0 view-items">
<?php //translators: Example - Viewing results: 1 to 12 of 345 ?>
<?php printf( __('Viewing results: %1$d to %2$d of %3$d', 'tainacan-interface'), $current_first_term_index, $current_last_term_index, $current_total_terms ); ?>
</div>
<div class="col-sm-5 pr-md-0 justify-content-md-end">
<?php
tainacan_the_taxonomies_pagination(
$current_total_terms,
array(
'paginate_links_extra_args' => array(
'mid_size' => 2,
'prev_text' => sprintf(
'%s',
'<i class="tainacan-icon tainacan-icon-arrowleft tainacan-icon-1-25em"></i>'
),
'next_text' => sprintf(
' %s',
'<i class="tainacan-icon tainacan-icon-arrowright tainacan-icon-1-25em"></i>'
),
'screen_reader_text' => ' '
)
)
);
?>
</div>
</div>
<?php }
endif;

View File

@ -59,37 +59,6 @@ function tainacan_wrap_comment( $content ) {
add_filter( 'comment_text', 'tainacan_wrap_comment', 99 ); add_filter( 'comment_text', 'tainacan_wrap_comment', 99 );
if ( ! function_exists( 'tainacan_pagination' ) ) :
function tainacan_pagination() {
global $wp_query;
$cur_posts = min( (int) $wp_query->get( 'posts_per_page' ), $wp_query->found_posts );
$to_paged = max( (int) $wp_query->get( 'paged' ), 1 );
$count_max = ( $to_paged - 1 ) * $cur_posts; ?>
<div class="d-flex margin-pagination justify-content-between border-top pt-2">
<div class="col-sm-3 d-none d-lg-block pl-0 view-items">
<?php //translators: Example - Viewing results: 1 to 12 of 345 ?>
<?php printf( __('Viewing results: %1$d to %2$d of %3$d', 'tainacan-interface'), $count_max + 1, $count_max + $wp_query->post_count, $wp_query->found_posts ); ?>
</div>
<div class="col-sm-5 pr-md-0 justify-content-md-end">
<?php the_posts_pagination(
array(
'mid_size' => 2,
'prev_text' => sprintf(
'%s',
'<i class="tainacan-icon tainacan-icon-arrowleft tainacan-icon-1-25em"></i>'
),
'next_text' => sprintf(
' %s',
'<i class="tainacan-icon tainacan-icon-arrowright tainacan-icon-1-25em"></i>'
),
'screen_reader_text' => ' '
)
); ?>
</div>
</div>
<?php }
endif;
/** /**
* Display date of post. * Display date of post.
*/ */

File diff suppressed because one or more lines are too long

View File

@ -1,12 +1,13 @@
<?php get_header(); ?> <?php get_header(); ?>
<?php $view_mode = esc_attr(get_query_var( 'tainacan_terms_viewmode', 'cards' )); ?>
<!-- Get the banner to display --> <!-- Get the banner to display -->
<?php get_template_part( 'template-parts/bannerheader' ); ?> <?php get_template_part( 'template-parts/bannerheader' ); ?>
<main class="mt-5 max-large margin-one-column"> <main class="mt-5 max-large margin-one-column">
<div class="row"> <div class="row">
<div class="col col-sm mx-sm-auto"> <div class="col col-sm mx-sm-auto">
<div class="tainacan-title"> <div class="tainacan-title">
<div class="tainacan-title-page"> <div class="tainacan-title-page">
<ul class="list-inline mb-1 d-flex"> <ul class="list-inline mb-1 d-flex">
@ -17,107 +18,67 @@
</ul> </ul>
</div> </div>
</div> </div>
<div class="form-inline mt-4 tainacan-collection-list--simple-search justify-content-between">
<?php if ( have_posts() ) : <div class="dropdown dropdown-sorting">
<button class="btn dropdown-toggle text-black" type="button" id="dropdownMenuSorting" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
do_action( 'tainacan-interface-single-item-top' ); <?php _e( 'Sorting', 'tainacan-interface' ); ?>
</button>
while ( have_posts() ) : <div class="dropdown-menu" aria-labelledby="dropdownMenuSorting">
<a class="dropdown-item text-black <?php tainacan_active( get_query_var( 'orderby' ), 'name' ); ?>" href="<?php echo add_query_arg( 'orderby', 'name' ); ?>"><?php _e( 'Name', 'tainacan-interface' ); ?></a>
the_post(); <a class="dropdown-item text-black <?php tainacan_active( get_query_var( 'orderby' ), 'count' ); ?>" href="<?php echo add_query_arg( 'orderby', 'count' ); ?>"><?php _e( 'Amount of items', 'tainacan-interface' ); ?></a>
?>
<div class="form-inline mt-4 tainacan-collection-list--simple-search justify-content-between">
<div class="dropdown dropdown-sorting">
<button class="btn dropdown-toggle text-black" type="button" id="dropdownMenuSorting" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<?php _e( 'Sorting', 'tainacan-interface' ); ?>
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuSorting">
<a class="dropdown-item text-black <?php tainacan_active( get_query_var( 'orderby' ), 'name' ); ?>" href="<?php echo add_query_arg( 'orderby', 'name' ); ?>"><?php _e( 'Name', 'tainacan-interface' ); ?></a>
<a class="dropdown-item text-black <?php tainacan_active( get_query_var( 'orderby' ), 'count' ); ?>" href="<?php echo add_query_arg( 'orderby', 'count' ); ?>"><?php _e( 'Amount of items', 'tainacan-interface' ); ?></a>
</div>
</div>
<a class="btn btn-white <?php tainacan_active( get_query_var( 'order' ), 'ASC' ); ?>" style="width: 2rem;" href="<?php echo add_query_arg( 'order', 'ASC' ); ?>">
<i class="tainacan-icon tainacan-icon-1-125em tainacan-icon-sortascending"></i>
</a>
<a class="btn btn-white <?php tainacan_active( get_query_var( 'order' ), 'DESC' ); ?>" style="width: 2rem;" href="<?php echo add_query_arg( 'order', 'DESC' ); ?>">
<i class="tainacan-icon tainacan-icon-1-125em tainacan-icon-sortdescending"></i>
</a>
<form role="search" class="ml-auto" method="get" id="tainacan-collection-search">
<input type="hidden" name="orderby" value="<?php echo esc_attr(get_query_var( 'orderby' )); ?>" />
<input type="hidden" name="order" value="<?php echo esc_attr(get_query_var( 'order' )); ?>" />
<input type="hidden" name="tainacan_collections_viewmode" value="<?php echo $view_mode; ?>" />
<div class="input-group">
<input class="form-control rounded-0" type="search" name="search" value="<?php echo get_query_var( 'search' ); ?>" placeholder="<?php esc_attr_e( 'Search terms', 'tainacan-interface' ); ?>" />
<span class="input-group-append">
<button class="btn border border-left-0 rounded-0 bg-white text-midnight-blue" type="submit">
<i class="tainacan-icon tainacan-icon-20px tainacan-icon-search" style="line-height: inherit;"></i>
</button>
</span>
</div>
</form>
</div> </div>
<?php </div>
$taxonomy_terms_list = tainacan_get_single_taxonomy_content($post, array( <a class="btn btn-white <?php tainacan_active( get_query_var( 'order' ), 'ASC' ); ?>" style="width: 2rem;" href="<?php echo add_query_arg( 'order', 'ASC' ); ?>">
'before_terms_list_container' => '<div class="tainacan-list-post px-md-0 mt-5 tainacan-taxonomy-terms-list-container">', <i class="tainacan-icon tainacan-icon-1-125em tainacan-icon-sortascending"></i>
'before_terms_list' => '<ul class="tainacan-list-collection--container-card justify-content-center tainacan-taxonomy-terms-list">', </a>
'after_terms_list' => '</ul>', <a class="btn btn-white <?php tainacan_active( get_query_var( 'order' ), 'DESC' ); ?>" style="width: 2rem;" href="<?php echo add_query_arg( 'order', 'DESC' ); ?>">
'before_term' => '<li class="tainacan-term-single tainacan-list-collection--card" id="term-id-$id">', <i class="tainacan-icon tainacan-icon-1-125em tainacan-icon-sortdescending"></i>
'after_term' => '</li>', </a>
'before_term_thumbnail' => '<figure class="term-thumbnail tainacan-list-collection--card-img rounded-0 align-self-center mr-3">',
'after_term_thumbnail' => '</figure>',
'before_term_description' => '<div class="term-description media-body text-oslo-gray"><p>',
'thumbnails_size' => 'tainacan-medium',
'hide_term_thumbnail_placeholder' => false,
'hide_term_description' => false,
'trim_description_words' => 20
));
echo $taxonomy_terms_list['content'];
$current_args = \Tainacan\Theme_Helper::get_instance()->get_taxonomies_query_args(); <div class="dropdown margin-one-column-left dropdown-viewMode">
$current_total_terms = $taxonomy_terms_list['total_terms']; <button class="btn dropdown-toggle text-black" type="button" id="dropdownMenuViewMode" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
$current_first_term_index = max(($current_args['termspaged'] - 1) * $current_args['perpage'] + 1, 1);
$current_last_term_index = min($current_args['termspaged'] * $current_args['perpage'], $current_total_terms);
?>
<div class="d-flex margin-pagination justify-content-between border-top pt-2">
<div class="col-sm-3 d-none d-lg-block pl-0 view-items">
<?php //translators: Example - Viewing results: 1 to 12 of 345 ?>
<?php printf( __('Viewing results: %1$d to %2$d of %3$d', 'tainacan-interface'), $current_first_term_index, $current_last_term_index, $current_total_terms ); ?>
</div>
<div class="col-sm-5 pr-md-0 justify-content-md-end">
<?php <?php
tainacan_the_taxonomies_pagination( switch($view_mode) {
$taxonomy_terms_list['total_terms'], case 'table':
array( echo '<i class="tainacan-icon tainacan-icon-1-125em tainacan-icon-viewtable text-oslo-gray"></i>';
'mid_size' => 2, break;
'prev_text' => sprintf( case 'grid':
'%s', echo '<i class="tainacan-icon tainacan-icon-1-125em tainacan-icon-viewminiature text-oslo-gray"></i>';
'<i class="tainacan-icon tainacan-icon-arrowleft tainacan-icon-1-25em"></i>' break;
), case 'cards':
'next_text' => sprintf( default:
' %s', echo '<i class="tainacan-icon tainacan-icon-1-125em tainacan-icon-viewcards text-oslo-gray"></i>';
'<i class="tainacan-icon tainacan-icon-arrowright tainacan-icon-1-25em"></i>' break;
), }
'screen_reader_text' => ' '
)
);
?> ?>
</div> <span class="d-none d-md-inline"><?php _e( 'View Mode', 'tainacan-interface' ); ?></span>
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuViewMode">
<a class="dropdown-item text-black <?php tainacan_active( $view_mode, 'cards' ); ?>" href="<?php echo add_query_arg( 'tainacan_terms_viewmode', 'cards' ); ?>"><i class="tainacan-icon tainacan-icon-1-125em tainacan-icon-viewcards text-oslo-gray"></i>&nbsp;<?php _e( 'Cards', 'tainacan-interface' ); ?></a>
<a class="dropdown-item text-black <?php tainacan_active( $view_mode, 'grid' ); ?>" href="<?php echo add_query_arg( 'tainacan_terms_viewmode', 'grid' ); ?>"><i class="tainacan-icon tainacan-icon-1-125em tainacan-icon-viewminiature text-oslo-gray"></i>&nbsp;<?php _e( 'Thumbnails', 'tainacan-interface' ); ?></a>
<a class="dropdown-item text-black <?php tainacan_active( $view_mode, 'table' ); ?>" href="<?php echo add_query_arg( 'tainacan_terms_viewmode', 'table' ); ?>"><i class="tainacan-icon tainacan-icon-1-125em tainacan-icon-viewtable text-oslo-gray"></i>&nbsp;<?php _e( 'Table', 'tainacan-interface' ); ?></a>
</div> </div>
<?php </div>
endwhile; <form role="search" class="ml-auto" method="get" id="tainacan-collection-search">
do_action( 'tainacan-interface-single-item-bottom' ); ?> <input type="hidden" name="orderby" value="<?php echo esc_attr(get_query_var( 'orderby' )); ?>" />
<input type="hidden" name="order" value="<?php echo esc_attr(get_query_var( 'order' )); ?>" />
<input type="hidden" name="tainacan_terms_viewmode" value="<?php echo $view_mode; ?>" />
<div class="input-group">
<input class="form-control rounded-0" type="search" name="search" value="<?php echo get_query_var( 'search' ); ?>" placeholder="<?php esc_attr_e( 'Search terms', 'tainacan-interface' ); ?>" />
<span class="input-group-append">
<button class="btn border border-left-0 rounded-0 bg-white text-midnight-blue" type="submit">
<i class="tainacan-icon tainacan-icon-20px tainacan-icon-search" style="line-height: inherit;"></i>
</button>
</span>
</div>
</form>
<?php else : ?> </div>
<?php _e( 'Nothing found', 'tainacan-interface' ); ?>
<?php endif; ?> <?php get_template_part( 'template-parts/loop-tainacan-terms', $view_mode ); ?>
</div> </div>
</div> </div>
</main> </main>

View File

@ -0,0 +1,33 @@
<?php if ( have_posts() ) : ?>
<?php while ( have_posts() ) {
the_post();
$taxonomy_terms_list = tainacan_get_single_taxonomy_content($post, array(
'before_terms_list_container' => '<div class="tainacan-list-post px-md-0 mt-5 tainacan-taxonomy-terms-list-container">',
'before_terms_list' => '<ul class="tainacan-list-collection--container-grid justify-content-center tainacan-taxonomy-terms-list">',
'after_terms_list' => '</ul>',
'before_term' => '<li class="tainacan-term-single tainacan-list-collection--grid" id="term-id-$id">',
'after_term' => '</li>',
'before_term_thumbnail' => '<figure class="term-thumbnail tainacan-list-collection--grid-img rounded-0 align-self-center mr-3">',
'after_term_thumbnail' => '</figure>',
'before_term_name' => '<h2 class="term-name text-truncate">',
'after_term_name' => '</h2>',
'thumbnails_size' => 'tainacan-medium',
'hide_term_thumbnail_placeholder' => false,
'hide_term_empty_name' => false,
'trim_description_words' => 20
));
echo $taxonomy_terms_list['content'];
$current_args = \Tainacan\Theme_Helper::get_instance()->get_taxonomies_query_args();
$current_total_terms = $taxonomy_terms_list['total_terms'];
$current_first_term_index = max(($current_args['termspaged'] - 1) * $current_args['perpage'] + 1, 1);
$current_last_term_index = min($current_args['termspaged'] * $current_args['perpage'], $current_total_terms);
// Terms pagination
tainacan_pagination_terms($current_total_terms);
} ?>
<?php else : ?>
<?php _e( 'Nothing found', 'tainacan-interface' ); ?>
<?php endif; ?>

View File

@ -0,0 +1,55 @@
<?php if ( have_posts() ) : ?>
<?php while ( have_posts() ) {
the_post();
$taxonomy_terms_list = tainacan_get_single_taxonomy_content($post, array(
'before_terms_list_container' => '<div class="mt-5 tainacan-list-post table-responsive">',
'after_terms_list_container' => '</div>',
'before_terms_list' => '<table class="table table-hover">
<thead>
<tr>
<th scope="col"></th>
<th scope="col">' . __( 'Name', 'tainacan-interface' ) . '</th>
<th scope="col">' . __( 'Description', 'tainacan-interface' ) . '</th>
<th scope="col">' . __( 'Children', 'tainacan-interface' ) . '</th>
<th scope="col">' . __( 'Items', 'tainacan-interface' ) . '</th>
</tr>
</thead>
<tbody>',
'after_terms_list' => '</tbody></table>',
'before_term' => '<tr class="tainacan-list-collection" id="term-id-$id">',
'after_term' => '</tr>',
'before_term_thumbnail' => '<td class="collection-miniature">',
'after_term_thumbnail' => '</td>',
'before_term_name' => '<td class="collection-title text-oslo-gray">',
'after_term_name' => '</td>',
'before_term_description' => '<td class="collection-description text-oslo-gray">',
'after_term_description' => '</td>',
'before_term_children_link' => '<td>',
'after_term_children_link' => '</td>',
'before_term_items_link' => '<td>',
'after_term_items_link' => '</td>',
'hide_term_empty_name' => false,
'hide_term_empty_description' => false,
'hide_term_empty_children_link' => false,
'hide_term_empty_items_link' => false,
'thumbnails_size' => 'tainacan-medium',
'hide_term_thumbnail_placeholder' => false,
'hide_term_description' => false,
'trim_description_words' => 32
));
echo $taxonomy_terms_list['content'];
$current_args = \Tainacan\Theme_Helper::get_instance()->get_taxonomies_query_args();
$current_total_terms = $taxonomy_terms_list['total_terms'];
$current_first_term_index = max(($current_args['termspaged'] - 1) * $current_args['perpage'] + 1, 1);
$current_last_term_index = min($current_args['termspaged'] * $current_args['perpage'], $current_total_terms);
} ?>
<?php tainacan_pagination_terms($current_total_terms); ?>
<?php else : ?>
<?php _e( 'Nothing found', 'tainacan-interface' ); ?>
<?php endif; ?>

View File

@ -0,0 +1,33 @@
<?php if ( have_posts() ) : ?>
<?php while ( have_posts() ) {
the_post();
$taxonomy_terms_list = tainacan_get_single_taxonomy_content($post, array(
'before_terms_list_container' => '<div class="tainacan-list-post px-md-0 mt-5 tainacan-taxonomy-terms-list-container">',
'before_terms_list' => '<ul class="tainacan-list-collection--container-card justify-content-center tainacan-taxonomy-terms-list">',
'after_terms_list' => '</ul>',
'before_term' => '<li class="tainacan-term-single tainacan-list-collection--card" id="term-id-$id">',
'after_term' => '</li>',
'before_term_thumbnail' => '<figure class="term-thumbnail tainacan-list-collection--card-img rounded-0 align-self-center mr-3">',
'after_term_thumbnail' => '</figure>',
'before_term_description' => '<div class="term-description media-body text-oslo-gray"><p>',
'thumbnails_size' => 'tainacan-medium',
'hide_term_thumbnail_placeholder' => false,
'hide_term_description' => false,
'hide_term_empty_name' => false,
'trim_description_words' => 20
));
echo $taxonomy_terms_list['content'];
$current_args = \Tainacan\Theme_Helper::get_instance()->get_taxonomies_query_args();
$current_total_terms = $taxonomy_terms_list['total_terms'];
$current_first_term_index = max(($current_args['termspaged'] - 1) * $current_args['perpage'] + 1, 1);
$current_last_term_index = min($current_args['termspaged'] * $current_args['perpage'], $current_total_terms);
// Terms pagination
tainacan_pagination_terms($current_total_terms);
} ?>
<?php else : ?>
<?php _e( 'Nothing found', 'tainacan-interface' ); ?>
<?php endif; ?>