Commit acc5886f by Simone

feature link all per shortcode swiper

parent f3224d00
...@@ -13,7 +13,8 @@ class SwiperController ...@@ -13,7 +13,8 @@ class SwiperController
'spacebetween' => 16, 'spacebetween' => 16,
'centeredslides' => true, 'centeredslides' => true,
'button_text' => '', 'button_text' => '',
'button_color' => 'white' 'button_color' => 'white',
'link_all' => 'false'
] ]
]; ];
} }
......
...@@ -30,9 +30,10 @@ if (!empty($this->atts['custom_post'])) { ...@@ -30,9 +30,10 @@ if (!empty($this->atts['custom_post'])) {
$the_query = new WP_Query($args); $the_query = new WP_Query($args);
if ($this->atts['gruppo']) { if ($this->atts['gruppo']) {
$term = get_term_by('slug',$this->atts['gruppo'],'swiper_group'); $term = get_term_by('slug', $this->atts['gruppo'], 'swiper_group');
$term_meta = get_option("taxonomy_term_$term->term_id"); $term_meta = get_option("taxonomy_term_$term->term_id");
$swiper_json = wp_unslash($term_meta["swiper_group_json"]); $swiper_json = wp_unslash($term_meta["swiper_group_json"]);
} }
if ($the_query->have_posts()) : ?> if ($the_query->have_posts()) : ?>
...@@ -50,7 +51,8 @@ if ($the_query->have_posts()) : ?> ...@@ -50,7 +51,8 @@ if ($the_query->have_posts()) : ?>
<?php echo $this->atts['button_text'] ?> <?php echo $this->atts['button_text'] ?>
</a> </a>
</div> </div>
<?php else : ?> <?php endif;?>
<?php if ( empty($this->atts['button_text']) || $this->atts['link_all']=='true' ) : ?>
<a class="card__link" href="<?php echo $link; ?>"></a> <a class="card__link" href="<?php echo $link; ?>"></a>
<?php endif; ?> <?php endif; ?>
<div class="card__inner"> <div class="card__inner">
...@@ -60,11 +62,11 @@ if ($the_query->have_posts()) : ?> ...@@ -60,11 +62,11 @@ if ($the_query->have_posts()) : ?>
<div class="card_caption"> <div class="card_caption">
<?php the_title() ?> <?php the_title() ?>
</div> </div>
<?php if( $post_type == 'laniakea_swiper'):?> <?php if ($post_type == 'laniakea_swiper') : ?>
<div class="card_content"> <div class="card_content">
<?php the_content() ?> <?php the_content() ?>
</div> </div>
<?php endif;?> <?php endif; ?>
</div> </div>
</div> </div>
</div> </div>
...@@ -90,17 +92,17 @@ if ($the_query->have_posts()) : ?> ...@@ -90,17 +92,17 @@ if ($the_query->have_posts()) : ?>
} }
} }
const swiperOptions = <?php const swiperOptions = <?php
if (!empty($swiper_json)) { if (!empty($swiper_json)) {
echo $swiper_json; echo $swiper_json;
} else { } else {
echo " echo "
{ {
speed: 400, speed: 400,
slidesPerView: 1, slidesPerView: 1,
spaceBetween: ".$this->atts['spacebetween'].", spaceBetween: " . $this->atts['spacebetween'] . ",
loop: ".$this->atts['loop'].", loop: " . $this->atts['loop'] . ",
initialSlide: ".$this->atts['initialslide']." , initialSlide: " . $this->atts['initialslide'] . " ,
centeredSlides: false, centeredSlides: false,
centerInsufficientSlides: false, centerInsufficientSlides: false,
scrollbar: { scrollbar: {
...@@ -125,9 +127,9 @@ if ($the_query->have_posts()) : ?> ...@@ -125,9 +127,9 @@ if ($the_query->have_posts()) : ?>
} }
}, },
}"; }";
} }
?> ?>
ready(function() { ready(function() {
const swiper = new Swiper('.swiper', swiperOptions); const swiper = new Swiper('.swiper', swiperOptions);
......
...@@ -863,7 +863,7 @@ main { ...@@ -863,7 +863,7 @@ main {
.swiper .card .vc_btn3-container { .swiper .card .vc_btn3-container {
position: absolute; position: absolute;
z-index: 2; z-index: 3;
margin: 0; margin: 0;
} }
......
...@@ -187,7 +187,7 @@ main { ...@@ -187,7 +187,7 @@ main {
.swiper .card .vc_btn3-container { .swiper .card .vc_btn3-container {
position: absolute; position: absolute;
z-index: 2; z-index: 3;
margin:0; margin:0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment