Checks if we are in a tainacan sincle item page to display short navigation links on breadcrumb.

This commit is contained in:
mateuswetah 2020-07-28 20:08:26 -03:00
parent 67312b0304
commit 4e73c4f631
4 changed files with 28 additions and 24 deletions

View File

@ -918,13 +918,13 @@
}
}
}
#header-meta_pagination {
#breadcrumb-single-item-pagination {
font-size: 0.875rem;
.pagination {
padding: 0 6px;
&:last-child {
padding: 0;
&:last-child {
padding: 0 6px;
}
a span {
display: none;

View File

@ -137,7 +137,10 @@ function tainacan_interface_the_breadcrumb() {
if ( is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author() ) echo ')';
}
if (is_single() && get_theme_mod('tainacan_single_item_show_navigation_options', false)) {
if ( defined ( 'TAINACAN_VERSION' ) ) {
$theme_helper = \Tainacan\Theme_Helper::get_instance();
if ($theme_helper->is_post_an_item(get_post()) && is_single() && get_theme_mod('tainacan_single_item_show_navigation_options', false)) {
$adjacent_links = tainacan_get_adjacent_item_links();
$previous = $adjacent_links['previous'];
@ -146,21 +149,22 @@ function tainacan_interface_the_breadcrumb() {
if ($previous !== '' || $next !== '') {
?>
<div
id="header-meta_pagination"
id="breadcrumb-single-item-pagination"
style="height: 1.125rem;" class="ml-auto d-flex align-items-center">
<div class="pagination">
<a href="<?php echo tainacan_get_source_item_list_url(); ?>"><i class="tainacan-icon tainacan-icon-viewtable tainacan-icon-1-25em"></i></a>
</div>
<div class="pagination">
<?php echo $previous; ?>
</div>
<div class="pagination">
<?php echo $next; ?>
</div>
<div class="pagination">
<a href="<?php echo tainacan_get_source_item_list_url(); ?>"><i class="tainacan-icon tainacan-icon-viewtable tainacan-icon-1-25em"></i></a>
</div>
</div>
<?php
}
}
}
echo '</nav>';

View File

@ -533,7 +533,7 @@ function tainacan_customize_register( $wp_customize ) {
'description' => __( 'Toggle to display two and a list icon for navigating directly from the item page breadcrumb section.', 'tainacan-interface' )
) );
$wp_customize->selective_refresh->add_partial( 'tainacan_single_show_hide_navigation_options', array(
'selector' => '#header-meta_pagination',
'selector' => '#breadcrumb-single-item-pagination',
'render_callback' => '__return_false',
'fallback_refresh' => true
) );

File diff suppressed because one or more lines are too long