initialized the carousel in attachmentts of items collections
This commit is contained in:
parent
47df76dbb6
commit
3e73b46fd3
|
@ -93,4 +93,49 @@ jQuery(document).ready(function( $ ) {
|
|||
$('.tainacan-list-post .table .tainacan-list-collection td').click(function(){
|
||||
window.location = $('.tainacan-list-post .table .tainacan-list-collection').data("href");
|
||||
});
|
||||
|
||||
$('.single-item-collection--attachments').slick({
|
||||
dots: true,
|
||||
speed: 300,
|
||||
variableWidth: true,
|
||||
prevArrow: '<button type="button" class="slick-prev"><i class="mdi mdi-menu-left"></i></button>',
|
||||
nextArrow: '<button type="button" class="slick-next"><i class="mdi mdi-menu-right"></i></button>',
|
||||
responsive: [
|
||||
{
|
||||
breakpoint: 1408,
|
||||
settings: {
|
||||
slidesToShow: 6,
|
||||
slidesToScroll: 1,
|
||||
infinite: true,
|
||||
dots: true
|
||||
}
|
||||
},
|
||||
{
|
||||
breakpoint: 1024,
|
||||
settings: {
|
||||
slidesToShow: 5,
|
||||
slidesToScroll: 1,
|
||||
infinite: true,
|
||||
dots: true
|
||||
}
|
||||
},
|
||||
{
|
||||
breakpoint: 768,
|
||||
settings: {
|
||||
slidesToShow: 4,
|
||||
slidesToScroll: 1
|
||||
}
|
||||
},
|
||||
{
|
||||
breakpoint: 480,
|
||||
settings: {
|
||||
slidesToShow: 2,
|
||||
slidesToScroll: 1
|
||||
}
|
||||
}
|
||||
// You can unslick at a given breakpoint now by adding:
|
||||
// settings: "unslick"
|
||||
// instead of a settings object
|
||||
]
|
||||
});
|
||||
});
|
||||
|
|
|
@ -47,21 +47,21 @@
|
|||
<article role="article">
|
||||
<section class="tainacan-content single-item-collection margin-two-column">
|
||||
<div class="single-item-collection--attachments">
|
||||
<?php
|
||||
$images = get_posts( array (
|
||||
'post_parent' => get_the_ID(),
|
||||
'post_type' => 'attachment',
|
||||
'post_per_page' => -1,
|
||||
'exclude' => get_post_thumbnail_id( get_the_ID() )
|
||||
));
|
||||
if ( empty($images) ) {
|
||||
echo 'no attachments here';
|
||||
} else {
|
||||
foreach ( $images as $attachment ) {
|
||||
echo wp_get_attachment_image( $attachment->ID, 'thumbnail' );
|
||||
}
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
$images = get_posts( array (
|
||||
'post_parent' => get_the_ID(),
|
||||
'post_type' => 'attachment',
|
||||
'post_per_page' => -1,
|
||||
'exclude' => get_post_thumbnail_id( get_the_ID() )
|
||||
));
|
||||
if ( empty($images) ) {
|
||||
echo 'no attachments here';
|
||||
} else {
|
||||
foreach ( $images as $attachment ) {
|
||||
echo '<div class="single-item-collection--attachments-img">' . wp_get_attachment_image( $attachment->ID, 'medium' ) . '</div>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</section>
|
||||
</article>
|
||||
|
|
Loading…
Reference in New Issue