Skip to content

Instantly share code, notes, and snippets.

@creativerty
creativerty / ACF Random Repeater
Last active December 31, 2015 19:09 — forked from wesrice/random-repeater.php
Gets random rows from ACF repeater fields with a count if required
<?php
// Get the repeater field
$repeater = get_field( 'repeater_field_name' );
// Count number of items
$total = count($repeater);
// Get a random rows. Change the second parameter in array_rand() to how many rows you want or keep as $total for all.
$random_rows = array_rand( $repeater, $total );
@creativerty
creativerty / gist:7929646
Last active December 31, 2015 03:48 — forked from tmayr/gist:5190565
Foundation ie8 nav fix
.lt-ie9 .top-bar {
background: #2f2f2f;
*zoom: 1;
overflow: visible;
}
.lt-ie9 .top-bar:before, .lt-ie9 .top-bar:after {
content: " ";
display: table;
}
.lt-ie9 .top-bar:after { clear: both; }
<?php
add_action( 'wp_enqueue_scripts', 'enqueue_my_styles' );
function enqueue_my_styles() {
global $wp_styles;
// Load the main stylesheet
wp_enqueue_style( 'my-theme', get_stylesheet_directory_uri() . '/style.css' );