Skip to content

Instantly share code, notes, and snippets.

@djrmom
djrmom / readme.txt
Last active March 2, 2024 17:53
facetwp radio button style as rectangular color button
Radio button facets are actual divs rather than radio input type html.
Radio facet as rectangular buttons - https://d.pr/i/cnyjEg
Facet settings for demo - https://d.pr/i/C5lAsc
If you want to add an "All" button - https://gist.github.com/djrmom/5870f7baf38fd5df40ee861bb95a01d5
@tdwesten
tdwesten / Fieldattributes-Cheatsheet.md
Last active February 16, 2023 20:33
Fields attributes cheatsheet

Fields attributes cheatsheet

This is a overview of all default attributes associated with the different ACF(pro) fields. This Cheatsheet is quite handy when creating ACF fields with the StoutLogic Acf Builder.

Last update: 27/09/2017 ACF version: 5.6.2

Text field

$attributes = [
    'default_value' => '',
@keesiemeijer
keesiemeijer / setup-phpunit.sh
Last active September 5, 2024 01:56
Setup PHPUnit for use in the Local by Flywheel app
#!/usr/bin/env bash
# ===============================================================================
# Script to install PHPUnit in the Local by Flywheel Mac app
# These packages are installed
#
# PHPUnit, curl wget, rsync, git, subversion and composer.
#
# WordPress is installed in the `/tmp/wordpress` directory for use by PHPUnit.
# The WordPress test suite is installed in the `/tmp/wordpress-tests-lib` directory.
@yratof
yratof / load.php
Last active January 30, 2023 08:41
ACF Load layouts into flex field
<?php
add_filter( 'acf/load_field/name=flex_layout', __CLASS__ . '::craft_content_layouts' );
static function craft_content_layouts( $field ) {
// Remove the layouts
// that are named in this list
$remove_list = [
'paragraph',
'banner',
// Shortcode
// source : https://wpbakery.atlassian.net/wiki/pages/viewpage.action?pageId=524362
if(!function_exists('carousel_content')){
function carousel_content( $atts, $content = null ) {
return '<div class="owl-carousel content-carousel content-slider">'.do_shortcode($content).'</div>';
}
add_shortcode('carousel_content', 'carousel_content');
}
@mgburns
mgburns / acf-field-registration-example.php
Created September 1, 2015 13:14
Example programmatic registration of Advanced Custom Fields fields
<?php
/**
* Example programmatic registration of Advanced Custom Fields fields
*
* @see http://www.advancedcustomfields.com/resources/register-fields-via-php/
*/
function register_custom_acf_fields() {
if ( function_exists( 'acf_add_local_field_group' ) ) {
@DevinWalker
DevinWalker / content-product.php
Last active September 19, 2021 23:09
Correct WooCommerce hooks for Total theme template override: woocommerce/content-product.php
<?php
/**
* The template for displaying product content within loops.
*
* Override this template by copying it to yourtheme/woocommerce/content-product.php
*
* @author WooThemes
* @package WooCommerce/Templates
* @version 1.6.4
*/
@jitendravyas
jitendravyas / gist:8d35b092dd9102a05ea3
Last active May 2, 2019 14:59
Brew Cask installation with Laptop script
#!/bin/sh
# homebrew taps
brew tap caskroom/cask
brew tap caskroom/versions
brew tap homebrew/boneyard
brew tap caskroom/fonts
# Updated grep
@bekarice
bekarice / edit-woocommerce-checkout-template.php
Last active October 28, 2024 06:16
Add content and notices to the WooCommerce checkout - sample code
/**
* Each of these samples can be used - note that you should pick one rather than add them all.
*
* How to use WC notices: https://github.com/woothemes/woocommerce/blob/master/includes/wc-notice-functions.php#L96
* Tutorial: http://www.skyverge.com/blog/edit-woocommerce-templates/
**/
/**
* Add a content block after all notices, such as the login and coupon notices.
*
@supercleanse
supercleanse / custom_signup.php
Created February 5, 2013 05:23
Shows how to add custom variables to a memberpress signup form.
<?php
/*
Plugin Name: MemberPress Custom Membership Signup
Plugin URI: http://memberpress.com
Description: Adds some custom fields to the MemberPress signup process
Version: 1.0.0
Author: MemberPress
Author URI: http://memberpress.com
Text Domain: memberpress
*/