Skip to content

Instantly share code, notes, and snippets.

@drrobotnik
Created April 15, 2015 17:03
Show Gist options
  • Save drrobotnik/b463c2d388dc3116559f to your computer and use it in GitHub Desktop.
Save drrobotnik/b463c2d388dc3116559f to your computer and use it in GitHub Desktop.
potential structure
::: layout file structure :::
acf/
layouts/
carousel-products/
layout.json
layout-carousel-products.php
css/
slick.min.css
style.css
...
js/
jquery.min.js
slick.min.js
main.js
...
img/
...
...
hero-slider/
layout.json
layout-hero-slider.php
css/
slick.min.css
style.css
...
js/
jquery.min.js
slick.min.js
main.js
...
img/
...
...
::: layout-carousel-products.php :::
if( !have_rows('carousel_products') )
return;
wp_enqueue_script('slick');
// loop through the rows of data
while ( have_rows('repeater_field_name') ) : the_row();
// display a sub field value
the_sub_field('sub_field_name');
endwhile;
::: layout-hero-slider.php :::
if( !have_rows('hero_slider') )
return;
wp_enqueue_script('slick');
// loop through the rows of data
while ( have_rows('repeater_field_name') ) : the_row();
// display a sub field value
the_sub_field('sub_field_name');
endwhile;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment