Created
January 16, 2020 15:19
-
-
Save blift/4c429fba79b5117fdd8a079c856ef373 to your computer and use it in GitHub Desktop.
ACF Pro Block, Sage 9, Gutenberg - Complete slider with image field, text field, color picker for change text bg.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Home page slider | |
.slick-homepage { | |
margin: 0 auto; | |
} | |
.slick-homepage>.slick-prev { | |
left: 40px !important; | |
z-index: 1; | |
} | |
.slick-homepage>.slick-next { | |
right: 40px !important; | |
z-index: 1; | |
} | |
.slick-homepage .home-slider-text { | |
width: 10% !important; | |
position: absolute; | |
bottom: 2%; | |
margin-left: 80px; | |
} | |
.slick-homepage .home-slider-text p { | |
padding: 30px; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default { | |
init() { | |
$('.slick-homepage').slick({ | |
arrows: true, | |
autoplaySpeed: 3000, | |
}); | |
}, | |
finalize() { | |
// JavaScript to be fired on the home page, after the init JS | |
}, | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{-- | |
Title: Slider Home | |
Description: Slider in fist section in home | |
Category: formatting | |
Icon: admin-comments | |
Keywords: testimonial quote | |
Mode: edit | |
Align: left | |
PostTypes: page post | |
SupportsAlign: left right | |
SupportsMode: false | |
SupportsMultiple: false | |
--}} | |
<div data-{{ $block['id'] }} class="{{ $block['classes'] }}"> | |
@if( have_rows('slider_images') ) | |
<div class="slick-homepage"> | |
@while( have_rows('slider_images') ) @php the_row(); @endphp | |
<li> | |
<img src="{{ get_sub_field('slider_home_image')['url'] }}" alt="{{ get_sub_field('slider_home_image')['alt'] }}" /> | |
<div class="home-slider-text"> | |
<div style="background-color:{{ get_sub_field('slider_text_bg_color') }}"> | |
{!! get_sub_field('slider_home_text') !!} | |
</div> | |
</div> | |
</li> | |
@endwhile | |
</div> | |
@endif | |
</div> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Very usefull solution!