Adjustments to Next and Previous links on single items page navigation.
This commit is contained in:
parent
827f035b25
commit
d3d3ce363e
|
@ -912,6 +912,9 @@
|
|||
flex-wrap: nowrap;
|
||||
align-items: center;
|
||||
}
|
||||
a:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
a[rel=prev]:hover {
|
||||
left: -7px;
|
||||
}
|
||||
|
@ -923,7 +926,7 @@
|
|||
width: auto;
|
||||
margin: 0.5rem;
|
||||
}
|
||||
a.has-large-thumbnail {
|
||||
a.has-large-thumbnail>div {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,15 +1,4 @@
|
|||
<?php
|
||||
$previous = '<i class="tainacan-icon tainacan-icon-arrowleft tainacan-icon-30px"></i> %link';
|
||||
$next = '%link <i class="tainacan-icon tainacan-icon-arrowright tainacan-icon-30px"></i>';
|
||||
|
||||
switch (get_theme_mod('tainacan_single_item_navigation_options', 'none')) {
|
||||
|
||||
case 'link':
|
||||
break;
|
||||
case 'thumbnail_small':
|
||||
//Get the thumnail url of the previous and next post
|
||||
$previous_thumb = get_the_post_thumbnail_url( get_previous_post(), 'tainacan-small' );
|
||||
$next_thumb = get_the_post_thumbnail_url( get_next_post(), 'tainacan-small' );
|
||||
|
||||
//Get the links to the Previous and Next Post
|
||||
$previous_link_url = get_permalink( get_previous_post() );
|
||||
|
@ -19,15 +8,34 @@
|
|||
$previous_title = get_the_title( get_previous_post() );
|
||||
$next_title = get_the_title( get_next_post() );
|
||||
|
||||
// Creates the links
|
||||
$previous = '<i class="tainacan-icon tainacan-icon-arrowleft tainacan-icon-30px"></i> ' .
|
||||
'<a class="has-small-thumbnail" rel="prev" href="' . $previous_link_url . '">' . $previous_title .
|
||||
'<img src="' . $previous_thumb . '" alt="">' .
|
||||
'</a>';
|
||||
$next = '<a class="has-small-thumbnail" rel="next" href="' . $next_link_url . '">' .
|
||||
'<img src="' . $next_thumb . '" alt="">' . $next_title .
|
||||
'</a>' . ' <i class="tainacan-icon tainacan-icon-arrowright tainacan-icon-30px"></i>';
|
||||
$previous = '';
|
||||
$next = '';
|
||||
|
||||
switch (get_theme_mod('tainacan_single_item_navigation_options', 'none')) {
|
||||
|
||||
case 'link':
|
||||
$previous = '<a rel="prev" href="' . $previous_link_url . '"><i class="tainacan-icon tainacan-icon-arrowleft tainacan-icon-30px"></i> ' . $previous_title . '</a>';
|
||||
$next = '<a rel="next" href="' . $next_link_url . '">' . $next_title . ' <i class="tainacan-icon tainacan-icon-arrowright tainacan-icon-30px"></i></a>';
|
||||
break;
|
||||
|
||||
case 'thumbnail_small':
|
||||
//Get the thumnail url of the previous and next post
|
||||
$previous_thumb = get_the_post_thumbnail_url( get_previous_post(), 'tainacan-small' );
|
||||
$next_thumb = get_the_post_thumbnail_url( get_next_post(), 'tainacan-small' );
|
||||
|
||||
// Creates the links
|
||||
$previous =
|
||||
'<a class="has-small-thumbnail" rel="prev" href="' . $previous_link_url . '">' .
|
||||
'<i class="tainacan-icon tainacan-icon-arrowleft tainacan-icon-30px"></i> ' .
|
||||
$previous_title . '<img src="' . $previous_thumb . '" alt="">' .
|
||||
'</a>';
|
||||
$next =
|
||||
'<a class="has-small-thumbnail" rel="next" href="' . $next_link_url . '">' .
|
||||
'<img src="' . $next_thumb . '" alt="">' . $next_title .
|
||||
' <i class="tainacan-icon tainacan-icon-arrowright tainacan-icon-30px"></i>' .
|
||||
'</a>';
|
||||
break;
|
||||
|
||||
case 'thumbnail_large':
|
||||
//Get the thumnail url of the previous and next post
|
||||
$previous_thumb = get_the_post_thumbnail_url( get_previous_post(), 'tainacan-medium' );
|
||||
|
@ -42,22 +50,27 @@
|
|||
$next_title = get_the_title( get_next_post() );
|
||||
|
||||
// Creates the links
|
||||
$previous = '<i class="tainacan-icon tainacan-icon-arrowleft tainacan-icon-36px"></i> ' .
|
||||
$previous =
|
||||
'<a class="has-large-thumbnail" rel="prev" href="' . $previous_link_url . '">' .
|
||||
'<img src="' . $previous_thumb . '" alt="">' . $previous_title .
|
||||
'<i class="tainacan-icon tainacan-icon-arrowleft tainacan-icon-36px"></i> ' .
|
||||
'<div><img src="' . $previous_thumb . '" alt="">' . $previous_title .
|
||||
'</div></a>';
|
||||
$next =
|
||||
'<a class="has-large-thumbnail" rel="next" href="' . $next_link_url . '">' .
|
||||
'<div><img src="' . $next_thumb . '" alt="">' . $next_title .
|
||||
'</div> <i class="tainacan-icon tainacan-icon-arrowright tainacan-icon-36px"></i>' .
|
||||
'</a>';
|
||||
$next = '<a class="has-large-thumbnail" rel="next" href="' . $next_link_url . '">' .
|
||||
'<img src="' . $next_thumb . '" alt="">' . $next_title .
|
||||
'</a>' . ' <i class="tainacan-icon tainacan-icon-arrowright tainacan-icon-36px"></i>';
|
||||
break;
|
||||
|
||||
case 'none':
|
||||
default:
|
||||
return '';
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
<div id="item-single-navigation" class="d-flex margin-pagination justify-content-between mt-0">
|
||||
<div class="tainacan-single-post">
|
||||
<h2 class="title-content-items"><?php echo __('Also in this collection', 'tainacan-interface') ?></h2>
|
||||
<div id="item-single-navigation" class="d-flex justify-content-between margin-two-column">
|
||||
<div class="pagination">
|
||||
<?php previous_post_link($previous); ?>
|
||||
</div>
|
||||
|
@ -65,3 +78,4 @@
|
|||
<?php next_post_link($next); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
Loading…
Reference in New Issue