Skip to content

Instantly share code, notes, and snippets.

@jmccall75
jmccall75 / functions.php
Last active January 9, 2024 03:15
Locking down Gutenberg...
<?php
/**
* Gutenberg Block customization for this theme.
*/
// gutenberg disable for posts
//add_filter('use_block_editor_for_post', '__return_false', 10);
// gutenberg disable for post types
//add_filter('use_block_editor_for_post_type', '__return_false', 10);
@yankiara
yankiara / oxygen-repeater-dynamic-query.php
Last active July 15, 2024 15:17
Use dynamic queries with Oxygen's repeater
/* I'll put here different examples of dynamic query for Oxygen repeater :
* - Use one of the following repeater_dynamic_query definitions
* in code block just BEFORE the repeater
* - Set the repeater custom query settings : post type, number of posts, order...
* - Add the remove_action in a code block AFTER the repeater
*/
/****************************************************************************************************
* Display related posts for any CPT with taxonomy:
@woogists
woogists / wc-remove-related-products.php
Last active December 29, 2023 16:55
[Theming Snippets] Remove related products output
@cmacdonnacha
cmacdonnacha / color-palette.scss
Created April 6, 2016 13:05
Material Design Color Palette
$white: #ffffff;
$black: #000000;
$red50: #ffebee;
$red100: #ffcdd2;
$red200: #ef9a9a;
$red300: #e57373;
$red400: #ef5350;
$red500: #f44336;
$red600: #e53935;
$red700: #d32f2f;
@icemilo
icemilo / calculateBusinessDays.js
Last active October 1, 2021 09:27
Calculates business days between two dates using moment.js
var moment = require('moment');
function calculateBusinessDays(firstDate, secondDate){
//Initiallize variables
var day1 = moment(firstDate);
var day2 = moment(secondDate);
var adjust = 0;
if((day1.dayOfYear() === day2.dayOfYear()) && (day1.year() === day2.year())){
return 0;
@landru247
landru247 / WordPress: Contact Form 7 - validation.
Created September 9, 2013 19:46
WordPress: Contact Form 7 - extend validation for things like phone numbers, zip codes, etc....
// Link to project page
// http://code-tricks.com/contact-form-7-custom-validation-in-wordpress/
//Available Names for text field with this file
date1 – Compare date1 (date2 should be bigger than date1)
date2 – Compare date2 (date2 should be bigger than date1)
url – validate URL
emailAddress – validate email address
@billerickson
billerickson / gist:3698476
Last active February 23, 2024 16:49 — forked from luetkemj/wp-query-ref.php
WP: Query $args
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php
*/
$args = array(
@cowboy
cowboy / HEY-YOU.md
Last active July 1, 2024 08:37
jQuery Tiny Pub/Sub: A really, really, REALLY tiny pub/sub implementation for jQuery.