Checks if we are in a tainacan sincle item page to display short navigation links on breadcrumb.
This commit is contained in:
parent
67312b0304
commit
4e73c4f631
|
@ -918,13 +918,13 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#header-meta_pagination {
|
#breadcrumb-single-item-pagination {
|
||||||
font-size: 0.875rem;
|
font-size: 0.875rem;
|
||||||
|
|
||||||
.pagination {
|
.pagination {
|
||||||
padding: 0 6px;
|
|
||||||
&:last-child {
|
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
&:last-child {
|
||||||
|
padding: 0 6px;
|
||||||
}
|
}
|
||||||
a span {
|
a span {
|
||||||
display: none;
|
display: none;
|
||||||
|
|
|
@ -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_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();
|
$adjacent_links = tainacan_get_adjacent_item_links();
|
||||||
$previous = $adjacent_links['previous'];
|
$previous = $adjacent_links['previous'];
|
||||||
|
@ -146,21 +149,22 @@ function tainacan_interface_the_breadcrumb() {
|
||||||
if ($previous !== '' || $next !== '') {
|
if ($previous !== '' || $next !== '') {
|
||||||
?>
|
?>
|
||||||
<div
|
<div
|
||||||
id="header-meta_pagination"
|
id="breadcrumb-single-item-pagination"
|
||||||
style="height: 1.125rem;" class="ml-auto d-flex align-items-center">
|
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">
|
<div class="pagination">
|
||||||
<?php echo $previous; ?>
|
<?php echo $previous; ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="pagination">
|
<div class="pagination">
|
||||||
<?php echo $next; ?>
|
<?php echo $next; ?>
|
||||||
</div>
|
</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>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
echo '</nav>';
|
echo '</nav>';
|
||||||
|
|
||||||
|
|
|
@ -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' )
|
'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(
|
$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',
|
'render_callback' => '__return_false',
|
||||||
'fallback_refresh' => true
|
'fallback_refresh' => true
|
||||||
) );
|
) );
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue