Uses new function tainacan_is_view_mode_enabled to check if slideshow is active before offering shortcut to open slideshow from current item
This commit is contained in:
parent
24a70a4208
commit
bdb514d5d3
|
@ -63,8 +63,6 @@
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
padding: 0.6rem 1.5rem;
|
padding: 0.6rem 1.5rem;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
color: #1d1d1d;
|
|
||||||
text-decoration: none !important;
|
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
p {
|
p {
|
||||||
|
@ -73,9 +71,14 @@
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
a,
|
||||||
|
a:hover {
|
||||||
|
color: #1d1d1d !important;
|
||||||
|
text-decoration: none !important;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
button.slideshow-icon {
|
.slideshow-icon {
|
||||||
border: none;
|
border: none;
|
||||||
background: none;
|
background: none;
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
|
@ -89,7 +92,7 @@
|
||||||
}
|
}
|
||||||
&:hover,
|
&:hover,
|
||||||
&:focus {
|
&:focus {
|
||||||
button.slideshow-icon {
|
.slideshow-icon {
|
||||||
transform: scale(1.0);
|
transform: scale(1.0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,32 +1,41 @@
|
||||||
<?php if ( have_posts() ) : ?>
|
<?php
|
||||||
|
$is_slideshow_available = false;
|
||||||
|
if (function_exists('tainacan_is_view_mode_enabled'))
|
||||||
|
$is_slideshow_available = tainacan_is_view_mode_enabled('slideshow');
|
||||||
|
?>
|
||||||
|
|
||||||
|
<?php if ( have_posts() ) : ?>
|
||||||
<div class="tainacan-grid-container">
|
<div class="tainacan-grid-container">
|
||||||
|
|
||||||
<?php $item_index = 0; while ( have_posts() ) : the_post(); ?>
|
<?php $item_index = 0; while ( have_posts() ) : the_post(); ?>
|
||||||
|
|
||||||
<a class="tainacan-grid-item" href="<?php the_permalink(); ?>">
|
<div class="tainacan-grid-item">
|
||||||
<div class="metadata-title">
|
<div class="metadata-title">
|
||||||
<p><?php the_title(); ?></p>
|
<p><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></p>
|
||||||
<a href="?<?php echo $_SERVER['QUERY_STRING'] ?>&slideshow-from=<?php echo $item_index ?>" class="icon slideshow-icon">
|
<?php if ( $is_slideshow_available ) : ?>
|
||||||
<i class="tainacan-icon tainacan-icon-viewgallery tainacan-icon-1-125em"></i>
|
<a href="?<?php echo $_SERVER['QUERY_STRING'] ?>&slideshow-from=<?php echo $item_index ?>" class="icon slideshow-icon">
|
||||||
</a>
|
<i class="tainacan-icon tainacan-icon-viewgallery tainacan-icon-1-125em"></i>
|
||||||
|
</a>
|
||||||
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
<?php if ( has_post_thumbnail() ) : ?>
|
<?php if ( has_post_thumbnail() ) : ?>
|
||||||
<div
|
<a
|
||||||
|
href="<?php the_permalink(); ?>"
|
||||||
style="background-image: url(<?php the_post_thumbnail_url( 'tainacan-medium' ) ?>)"
|
style="background-image: url(<?php the_post_thumbnail_url( 'tainacan-medium' ) ?>)"
|
||||||
class="grid-item-thumbnail">
|
class="grid-item-thumbnail">
|
||||||
<?php the_post_thumbnail( 'tainacan-medium' ); ?>
|
<?php the_post_thumbnail( 'tainacan-medium' ); ?>
|
||||||
<div class="skeleton"></div>
|
<div class="skeleton"></div>
|
||||||
</div>
|
</a>
|
||||||
<?php else : ?>
|
<?php else : ?>
|
||||||
<div
|
<a
|
||||||
|
href="<?php the_permalink(); ?>"
|
||||||
style="background-image: url(<?php echo esc_url( get_template_directory_uri() ) . '/assets/images/thumbnail_placeholder.png'?>)"
|
style="background-image: url(<?php echo esc_url( get_template_directory_uri() ) . '/assets/images/thumbnail_placeholder.png'?>)"
|
||||||
class="grid-item-thumbnail">
|
class="grid-item-thumbnail">
|
||||||
<?php echo '<img alt="', esc_attr_e('Thumbnail placeholder', 'tainacan-interface'), '" src="', esc_url(get_template_directory_uri()), '/assets/images/thumbnail_placeholder.png">'?>
|
<?php echo '<img alt="', esc_attr_e('Thumbnail placeholder', 'tainacan-interface'), '" src="', esc_url(get_template_directory_uri()), '/assets/images/thumbnail_placeholder.png">'?>
|
||||||
<div class="skeleton"></div>
|
<div class="skeleton"></div>
|
||||||
</div>
|
</a>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</a>
|
</div>
|
||||||
|
|
||||||
<?php $item_index++; endwhile; ?>
|
<?php $item_index++; endwhile; ?>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue