Skip to content

Instantly share code, notes, and snippets.

@dajocarter
dajocarter / acfRepeater.php
Created January 26, 2016 03:49
Example of using an Advanced Custom Field Repeater
<?php if (have_rows('field_name')) : ?>
<!-- This container is optional, yet usual -->
<ul id="repeater-container" class="container">
<?php while (have_rows('field_name')) : the_row(); ?>
<!-- Place the markup you want to repeat here -->
<li class="repeated-item">
<?php the_sub_field('sub_field_name'); ?>
</li>
<?php endwhile; ?>
</ul>
@dajocarter
dajocarter / sliderExample.php
Created January 26, 2016 04:08
Example of using a slider with Glide.js and Scratch Theme for Wordpress + ACF
<?php if(have_rows('slides')): ?>
<div id="Glide" class="glide clearfix">
<div class="glide__arrows">
<!--
Options for arrow classes are: ion-chevron-left/right, ion-ios-arrow-left/right, ion-ios-arrow-back/forward.
Can also substitute <i></i> with text, e.g., Previous and Next.
-->
<button class="glide__arrow prev" data-glide-dir="<"><i class="ion ion-chevron-left"></i></button>
<button class="glide__arrow next" data-glide-dir=">"><i class="ion ion-chevron-right"></i></button>
@dajocarter
dajocarter / add_custom_css.php
Last active June 26, 2017 15:16
WooCommerce Adjustments. Throw these in the functions.php file of your theme.
add_filter( 'woocommerce_enqueue_styles', 'my_woocommerce_styles' );
function my_woocommerce_styles($styles){
unset($styles['woocommerce-layout']);
unset($styles['woocommerce-smallscreen']);
$styles['woocommerce-layout'] = array(
'src' => get_template_directory_uri() . '/css/woocommerce.css',
'deps' => '',
'version' => '1.0.0',
'media' => 'all'
);