Skip to content

Instantly share code, notes, and snippets.

@GrindPress
GrindPress / acf-inline-svg.php
Created March 16, 2021 22:29 — forked from derekshirk/acf-inline-svg.php
Output Inline SVGs from ACF image field
<?php
/* ————————————————————————— */
/* ACF Inline SVGs
/* ————————————————————————— */
$repeater = 'repeater_field_name'
if ( have_rows( $repeater ) ): ?>
<section class="content-main">
<div class="container"> <?php
@GrindPress
GrindPress / demo.html
Created March 5, 2021 18:00 — forked from portal7/demo.html
jQuery Validator Email Domain
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/jquery.validation/1.16.0/jquery.validate.min.js"></script>
<script src="https://cdn.jsdelivr.net/jquery.validation/1.16.0/additional-methods.min.js"></script>
<form id="myForm" name="myForm" action="#" method="POST"> <style>#email-error { display: block; color: red; }</style>
<label for="email">Email: </label>
<input id="email" name="email" type="email" minlength="6"/><br>
<input type="submit" value="Submit">
</form>
@GrindPress
GrindPress / GFORM: GFAPI::get_entries + pagination
Created July 14, 2020 01:24 — forked from kenmasters/GFORM: GFAPI::get_entries + pagination
List gravityform entries using GFAPI class + pagination
# http://inlinedocs.gravityhelp.com/class-GFAPI.html
# https://docs.gravityforms.com/getting-started-with-the-gravity-forms-api-gfapi/
# working code
# notes: we are to going to lists submitted entries of the current loggedin user.
$form_ids = [19, 20, 21, 22, 23, 24, 25, 26]; // accepts single or array of form id's.
$search_criteria = array(
'field_filters' => array(
'mode' => 'any',
@GrindPress
GrindPress / custom-hooks.php
Created June 29, 2020 19:07
facetwp infinite scroll
<?php
/** adds a scroll handler to turn load more into a infinite scroll **/
add_action( 'wp_footer', function() {
?>
<script>
(function($) {
if ('object' !== typeof FWP) {
return;
@GrindPress
GrindPress / functions.php
Created July 10, 2019 18:15 — forked from yratof/functions.php
ACF OEmbed with thumbnails
<?php
/* Pull apart OEmbed video link to get thumbnails out*/
function get_video_thumbnail_uri( $video_uri ) {
$thumbnail_uri = '';
// determine the type of video and the video id
$video = parse_video_uri( $video_uri );
// get youtube thumbnail
@GrindPress
GrindPress / SQL.txt
Created February 19, 2018 18:11
Change URL's in PHPmyAdmin from the SQL Tab
UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldurl', 'http://www.newurl') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'http://www.oldurl','http://www.newurl');
UPDATE wp_posts SET post_content = replace(post_content, 'http://www.oldurl', 'http://www.newurl');
UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.oldurl','http://www.newurl');
@GrindPress
GrindPress / bower.json
Last active April 4, 2018 05:24
Foundation 6.4.3 Bower JS overrides (remove any unused files)
{
"name": "gp-sage-foundation",
"homepage": "https://grindpress.com",
"authors": [
"Shaun Burrell <shaun@grindpress.com>"
],
"license": "MIT",
"private": true,
"dependencies": {
"foundation-sites": "^6.4.3"
@GrindPress
GrindPress / movegfjstofooter.php
Created November 13, 2017 15:46 — forked from eriteric/movegfjstofooter.php
Load gravity forms JS in footer
/*
*
* Gravity Forms JS to Footer
*
-----------------------------------------------------------------------*/
// Force Gravity Forms to init scripts in the footer and ensure that the DOM is loaded before scripts are executed
add_filter( 'gform_init_scripts_footer', '__return_true' );
function wrap_gform_cdata_open( $content = '' ) {
@GrindPress
GrindPress / .htaccess
Created August 9, 2017 23:19 — forked from rorymcdaniel/.htaccess
Pull Uploads from Production in WordPress staging environment
# /wp-content/uploads/.htaccess
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule (.*) http://www.yourproductionserver.com/wp-content/uploads/$1 [L]
/*
* CSS3 triangle Mixin
* @param {Direction} $direction - Triangle direction, either `top`, `right`, `bottom` or `left`
* @param {Color} $color - Triangle color
* @param {Length} $size [1em] - Triangle size
*
* Useage - @include triangle(#000,1em,right);
* place in the parent element
* https://css-tricks.com/snippets/css/css-triangle/
*