Skip to content

Instantly share code, notes, and snippets.

View craigsimps's full-sized avatar

Craig Simpson craigsimps

View GitHub Profile
@jeffgolenski
jeffgolenski / WordPress Comment Styling SCSS
Last active October 19, 2022 14:25
SCSS WordPress Comment Styles. Based on the WordPress threaded comments CSS over at css-tricks.com, I created this nested SCSS. It's basic, simple, and clean. Quickly copy, paste, and style away! Original CSS located at: http://css-tricks.com/snippets/wordpress/base-threaded-comments-styling/
/* =========================================================
Comments
========================================================= */
ol.commentlist {
list-style:none;
margin:0 0 1em;
padding:0;
text-indent:0;
@jdevalk
jdevalk / .htaccess
Last active November 28, 2023 20:28
These three files together form an affiliate link redirect script.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^index\.php$ - [L]
RewriteRule (.*) ./index.php?id=$1 [L]
</IfModule>
@dobbyloo
dobbyloo / AssetRegister.php
Created March 4, 2014 21:56
Wordpress: wrapper class to register/enqueue styles and scripts in a theme.
<?php namespace PaintedCloud\WP\Classes;
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
class AssetRegister {
public $scripts_base_uri;
public $styles_base_uri;
protected $scripts;
protected $stylesheets;
@tmoitie
tmoitie / gist:9808555
Last active April 18, 2024 18:56
Wordpress: Gravity Forms List to ACF Repeater post save
<?php
add_action('gform_after_submission', 'gfToAcfListToRepeater', 10, 2);
function gfToAcfListToRepeater($entry, $form)
{
foreach ($form['fields'] as $field) {
if (!($field['type'] == 'post_custom_field' && $field['inputType'] == 'list' && $field['enableColumns'] == true)) {
continue;
}
$id = $field['id'];
@Rarst
Rarst / WordPress.xml
Last active August 5, 2021 04:14
WordPress Live Templates for PhpStorm
<?xml version="1.0" encoding="UTF-8"?>
<templateSet group="WordPress">
<template name="aa" value="add_action( '$hook$', '$callback$' );&#10;$END$" description="add_action" toReformat="false" toShortenFQNames="true">
<variable name="hook" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="callback" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="HTML_TEXT" value="false" />
<option name="HTML" value="false" />
<option name="XSL_TEXT" value="false" />
<option name="XML" value="false" />
@nathanrice
nathanrice / functions.php
Created August 31, 2015 14:59
Remove entry meta for post types
<?php
add_action( 'init', 'sample_remove_entry_meta', 11 );
/**
* Remove entry meta for post types
*
* @link https://gist.github.com/nathanrice/03a5871e5e5a27f22747
*/
function sample_remove_entry_meta() {
remove_post_type_support( 'post-type', 'genesis-entry-meta-before-content' );
@tomjn
tomjn / behave.js
Last active April 17, 2018 19:45
Adds a shortcode to WordPress that lets you test escaping and sanitising functions on content
/*
* Behave.js
*
* Copyright 2013, Jacob Kelley - http://jakiestfu.com/
* Released under the MIT Licence
* http://opensource.org/licenses/MIT
*
* Github: http://github.com/jakiestfu/Behave.js/
* Version: 1.5
*/
@johnbillion
johnbillion / wp_mail.md
Last active January 27, 2024 14:06
WordPress Emails

WordPress Emails

This document lists all the situations where WordPress sends an email, along with how to filter or disable each email.

This documentation has moved here: https://github.com/johnbillion/wp_mail

@laverboy
laverboy / LogUse.php
Last active March 5, 2024 22:29
A simple, static, logging singleton class
<?php
Log::info("something really interesting happened", ['extra' => 'information', 'about' => 'anything' ]);
@bryanwillis
bryanwillis / bootstrap-genesis-structural-wraps.php
Last active October 5, 2020 18:16
Adding genesis-structural-wrap-support to Bootstrap Genesis
<?php
/**
* Module: Bootstrap Genesis Plugin - Structural Wraps
* Author: Bryan Willis
*/
/**
* Add theme support for structural wraps
*/
function gb3_add_theme_support_structural_wraps() {