b2dd3eec by Jeff Balicki

remove quotes

Signed-off-by: Jeff <jeff@gotenzing.com>
1 parent 321ec4aa
<?php
/**
* Quotes Block Template.
*
* @param array $block The block settings and attributes.
* @param string $content The block inner HTML (empty).
* @param bool $is_preview True during AJAX preview.
* @param (int|string) $post_id The post ID this block is saved to.
*/
// Create id attribute allowing for custom "anchor" value.
$id = 'slider-' . $block['id'];
if( !empty($block['anchor']) ) {
$id = $block['anchor'];
}
// Create class attribute allowing for custom "className" and "align" values.
$className = 'slider';
if( !empty($block['className']) ) {
$className .= ' ' . $block['className'];
}
if( !empty($block['align']) ) {
$className .= ' align' . $block['align'];
}
if( $is_preview ) {
$className .= ' is-admin';
}
?>
<div id="<?php echo esc_attr($id); ?>" class="<?php echo esc_attr($className); ?> quotes same-height">
<h3>SOME OF OUR BEST QUOTES:</h3>
<?php if( have_rows('quote') ): ?>
<ul class="slides">
<?php while( have_rows('quote') ): the_row();
$image = get_sub_field('image');
?>
<li class="container quote">
<div class="row">
<div class="col col-sm-4">
<img class="quote_image" src="<?php echo $image['url'];?>" />
</div>
<div class="col col-sm-8"><p><?php the_sub_field('text'); ?></p></div>
</div>
</li>
<?php endwhile; ?>
</ul>
<?php else: ?>
<p>Please add some slides.</p>
<?php endif; ?>
</div>
(function($){
/**
* initializeBlock
*
* Adds custom JavaScript to the block HTML.
*
* @date 15/4/19
* @since 1.0.0
*
* @param object $block The block jQuery element.
* @param object attributes The block attributes (only available when editing).
* @return void
*/
var initializeBlock = function( $block ) {
$block.find('.slides').slick({
dots: false,
infinite: true,
speed: 300,
slidesToShow: 1,
autoplay: true,
autoplaySpeed: 4000,
adaptiveHeight: false,
arrows:true
});
}
// Initialize each block on page load (front end).
$(document).ready(function(){
$('.slider').each(function(){
initializeBlock( $(this) );
});
});
// Initialize dynamic block preview (editor).
if( window.acf ) {
window.acf.addAction( 'render_block_preview/type=quote', initializeBlock );
}
})(jQuery);
\ No newline at end of file
.quotes{
background-color:#D6EAF9;
padding: 30px 50px;
}
@media (max-width: 768px){
.quotes{
padding: 20px 20%;
margin: -5%;
}
}
.quotes .slides{
list-style: none;
margin-block-start: 0em;
margin-block-end: 0em;
margin-inline-start: 0px;
margin-inline-end: 0px;
padding-inline-start: 0px;
}
.container.quote{
width: 100%;
}
.container.quote .row {
margin-right: -15px !important;
margin-left: -15px !important;
}
.container.quote p{
font-size: 16px !important;
line-height:21px !important;
font-style: italic;
}
.quotes h3{
font-size: 25px !important;
line-height:25px !important;
text-align:left;
margin-left: 3% !important;
}
@media (max-width: 768px){
.quotes h3{
text-align:center;
margin-bottom: -20px;
margin-left: 0% !important;
}
}
.quote_image{
width: 100%;
}
.no-padding{
padding-top: 0rem;
padding-bottom: 0rem;
}
.slick-next{
right: -25px;
z-index: 9999;
top: 30%;
}
.slick-prev {
left: -30px;
z-index: 9999;
top: 30%;
}
@media (max-width: 768px){
.slick-next{
right: -55px;
z-index: 9999;
top: 30%;
}
.slick-prev {
left: -55px;
z-index: 9999;
top: 30%;
}
}
.slick-next:before{
content: " ";
background-image: url(next-arrow.png);
background-size: contain;
width: 50px !important;
height: 50px !important;
display: block;
background-repeat: no-repeat;
}
.slick-prev:before{
content: " ";
background-image: url(previous-arrow.png);
background-size: contain;
width: 50px !important;
height: 50px !important;
display: block;
background-repeat: no-repeat;
}
\ No newline at end of file