Merge pull request #62 from tainacan/feature/59

Adds archive-terms.php to display a Taxonomy list of Terms. #59
This commit is contained in:
Mateus Machado Luna 2023-02-28 14:39:56 -03:00 committed by GitHub
commit a78d0f8f8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 531 additions and 128 deletions

View File

@ -231,3 +231,4 @@ footer.tainacan-footer {
}
}
}
footer .wp-block-group ul { padding-inline-start: 1rem; }

View File

@ -114,6 +114,7 @@
padding-right: 0;
}
.collection-miniature{
min-width: 70px;
padding-left: 20px;
text-align: center;
img{
@ -243,7 +244,7 @@
line-height: 0.75rem;
}
.tainacan-list-collection--grid-img {
width: 275px;
width: 250px;
height: 250px;
}
.image-placeholder {

View File

@ -4,7 +4,8 @@
font-weight: 400;
color: #898d8f;
padding: 0 1rem;
margin-top: 5rem;
margin-top: 4rem;
margin-bottom: 2rem;
.pagination{
.nav-links {

View File

@ -0,0 +1,64 @@
.tainacan-taxonomy-terms-list-container .tainacan-taxonomy-terms-list {
list-style: none;
&.tainacan-list-collection--container-card {
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;
}
}
&.tainacan-list-collection--container-grid {
.term-name {
margin-bottom: 0.25rem;
font-size: 1.125rem !important;
}
.term-children-link a {
margin-bottom: 1.5rem;
}
.term-items-link a {
margin-bottom: 1.5rem;
}
.term-thumbnail {
margin-top: 1rem;
margin-bottom: 0rem;
}
}
}
.tainacan-taxonomy-terms-list-container table {
.term-description {
width: 48%;
}
}
.tainacan-taxonomies-pagination-links {
text-align: end;
}

View File

@ -13,7 +13,6 @@ $mercury: #e5e5e5;
$tundora: #4e4e4e;
$white-title: rgba(255, 255, 255, 0.6);
$theme-colors: (
"heavy-metal": $heavy-metal,
"jelly-bean": $jelly-bean,
@ -28,7 +27,8 @@ $theme-colors: (
"silver": $silver,
"mercury": $mercury,
"tundora": $tundora,
"white-title": $white-title
"white-title": $white-title,
"primary": #298596
);
$font-family-base: 'Roboto';
$headings-font-family: 'Roboto';

View File

@ -1336,3 +1336,5 @@ nav {
@import "_single-item-collection";
@import "_tainacan-items-list";
@import "_tainacan-terms-list";

View File

@ -1,4 +1,5 @@
<?php if ( ! is_404() ) : ?>
<?php if ( ! is_404() ) :
if ( !get_theme_mod('tainacan_use_block_template_parts_on_footer', false) ) : ?>
<footer class="container-fluid p-4 p-sm-5 mt-5 tainacan-footer <?php echo esc_attr( ('tainacan-footer-' . get_theme_mod( 'tainacan_footer_color', 'dark' )) ) ?>" style="padding-bottom: 0 !important;">
<?php if ( is_active_sidebar( 'tainacan-sidebar-footer' ) ) { ?>
<div class="row tainacan-footer-widgets-area">
@ -59,6 +60,10 @@
</div>
</div>
</footer>
<?php else:
block_template_part( 'footer' );
endif;
?>
<?php endif; ?>
<?php wp_footer(); ?>
</body>

View File

@ -3,6 +3,10 @@
/** Theme version */
const TAINACAN_INTERFACE_VERSION = '2.6';
/* Disables Tainacan Theme Helper the_content filter, which is used to build a custom item and taxonomy (terms list) template. */
define('TAINACAN_DISABLE_ITEM_THE_CONTENT_FILTER', true);
define('TAINACAN_DISABLE_TAXONOMY_THE_CONTENT_FILTER', true);
/**
* Setup Theme
*/
@ -194,6 +198,7 @@ if ( ! function_exists( 'tainacan_setup' ) ) {
add_theme_support( 'appearance-tools' );
add_theme_support( 'editor-style' );
add_editor_style( 'editor-style.css' );
add_theme_support( 'block-template-parts' );
}
} // tainacan_setup check
@ -394,37 +399,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.
*/
@ -465,5 +439,6 @@ add_action( 'enqueue_block_editor_assets', 'tainacan_editor_styles' );
require get_template_directory() . '/functions/customizer.php';
require get_template_directory() . '/functions/patterns.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/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

@ -52,6 +52,7 @@ function tainacan_customize_register( $wp_customize ) {
}
}
}
add_action( 'customize_register', 'tainacan_customize_register', 11 );

View File

@ -130,6 +130,21 @@ if ( !function_exists('tainacan_interface_customize_register_footer_info') ) {
'description' => __( 'This checkbox shows the "Proudly Powered by WordPress and Tainacan" sentence.', 'tainacan-interface' ),
) );
// Use block Template Parts for Footer
$wp_customize->add_setting( 'tainacan_use_block_template_parts_on_footer', array(
'type' => 'theme_mod',
'default' => false,
'capability' => 'edit_theme_options',
'sanitize_callback' => 'tainacan_callback_sanitize_checkbox',
) );
$wp_customize->add_control( 'tainacan_use_block_template_parts_on_footer', array(
'type' => 'checkbox',
'settings' => 'tainacan_use_block_template_parts_on_footer',
'section' => 'tainacan_interface_footer_info',
'label' => __( 'Use block template parts to configure footer', 'tainacan-interface' ),
'description' => __( 'Build your own footer using the block editor in the menu Appearance -> Template Parts -> Footer.', 'tainacan-interface')
) );
}
add_action( 'customize_register', 'tainacan_interface_customize_register_footer_info', 11 );

View File

@ -59,37 +59,6 @@ function tainacan_wrap_comment( $content ) {
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.
*/

47
src/parts/footer.html Normal file
View File

@ -0,0 +1,47 @@
<!-- wp:group {"style":{"elements":{"link":{"color":{"text":"var:preset|color|white"}}},"spacing":{"padding":{"top":"3rem","right":"0rem","bottom":"3rem","left":"0rem"}},"color":{"background":"#2c2d2d"}},"textColor":"white","layout":{"inherit":true,"type":"constrained"}} -->
<div class="wp-block-group has-white-color has-text-color has-background has-link-color" style="background-color:#2c2d2d;padding-top:3rem;padding-right:0rem;padding-bottom:3rem;padding-left:0rem">
<!-- wp:separator {"align":"wide","backgroundColor":"default","className":"is-style-wide"} -->
<hr class="wp-block-separator alignwide has-text-color has-default-color has-alpha-channel-opacity has-default-background-color has-background is-style-wide"/>
<!-- /wp:separator -->
<!-- wp:group {"style":{"spacing":{"blockGap":"4.2%"}},"layout":{"type":"flex","flexWrap":"wrap","justifyContent":"space-between","verticalAlignment":"top"}} -->
<div class="wp-block-group">
<!-- wp:group {"style":{"elements":{"link":{"color":{"text":"var:preset|color|white"}}}},"layout":{"type":"constrained"}} -->
<div class="wp-block-group has-link-color">
<!-- wp:paragraph -->
<p>
<strong>Arquivo</strong>
</p>
<!-- /wp:paragraph -->
<!-- wp:archives /-->
</div>
<!-- /wp:group -->
<!-- wp:group {"layout":{"type":"constrained"}} -->
<div class="wp-block-group">
<!-- wp:paragraph -->
<p>
<strong>Páginas</strong>
</p>
<!-- /wp:paragraph -->
<!-- wp:page-list /-->
</div>
<!-- /wp:group -->
<!-- wp:group {"layout":{"type":"constrained"}} -->
<div class="wp-block-group">
<!-- wp:paragraph -->
<p>
<strong>Categorias</strong>
</p>
<!-- /wp:paragraph -->
<!-- wp:categories /-->
</div>
<!-- /wp:group -->
</div>
<!-- /wp:group -->
</div>
<!-- /wp:group -->

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,94 @@
<?php get_header(); ?>
<?php $view_mode = esc_attr(get_query_var( 'tainacan_terms_viewmode', 'cards' )); ?>
<!-- Get the banner to display -->
<?php get_template_part( 'template-parts/bannerheader' ); ?>
<main class="mt-5 max-large margin-one-column">
<div class="row">
<div class="col col-sm mx-sm-auto">
<div class="tainacan-title">
<div class="tainacan-title-page">
<ul class="list-inline mb-1 d-flex">
<li class="list-inline-item font-weight-bold title-page">
<h1><?php the_title(); ?></h1>
</li>
<li class="list-inline-item float-right title-back align-self-end ml-auto"><a href="javascript:history.go(-1)"><?php _e( 'Back', 'tainacan-interface' ); ?></a></li>
</ul>
</div>
</div>
<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>
<div class="dropdown margin-one-column-left dropdown-viewMode">
<button class="btn dropdown-toggle text-black" type="button" id="dropdownMenuViewMode" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<?php
switch($view_mode) {
case 'table':
echo '<i class="tainacan-icon tainacan-icon-1-125em tainacan-icon-viewtable text-oslo-gray"></i>';
break;
case 'grid':
echo '<i class="tainacan-icon tainacan-icon-1-125em tainacan-icon-viewminiature text-oslo-gray"></i>';
break;
case 'cards':
default:
echo '<i class="tainacan-icon tainacan-icon-1-125em tainacan-icon-viewcards text-oslo-gray"></i>';
break;
}
?>
<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>
<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_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>
</div>
<?php
if ( function_exists('tainacan_get_single_taxonomy_content') )
get_template_part( 'template-parts/loop-tainacan-terms', $view_mode );
else {
echo '<div style="text-aling: center; max-width: 600px; margin: 2em auto; width: 100%; font-style: italic;">';
echo '<p>' . __('It seems that you are using a legacy vesion of the Tainacan plugin. Please update in order to use the latest features for displaying the terms list.', 'tainacan-interface') . '</p>';
echo '</div>';
}
?>
</div>
</div>
</main>
<?php get_footer(); ?>

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 tainacan-taxonomy-terms-list-container">',
'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 term-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; ?>