Skip to content

Instantly share code, notes, and snippets.

View sisaacrussell's full-sized avatar

Isaac Russell sisaacrussell

View GitHub Profile
<?php
// Divi Builder on custom post types by https://wpcolt.com
add_filter('et_builder_post_types', 'divicolt_post_types');
add_filter('et_fb_post_types','divicolt_post_types' );
// Enable Divi Visual Builder on the custom post types
function divicolt_post_types($post_types)
{
foreach (get_post_types() as $post_type) {
if (!in_array($post_type, $post_types) and post_type_supports($post_type, 'editor')) {
$post_types[] = $post_type;
@sisaacrussell
sisaacrussell / default-template.php
Last active February 21, 2017 14:58 — forked from skyshab/default-template.php
Custom code I used to integrate The Event Calendar with Divi
<?php
/**
* Custom Events Template
* This file is the basic wrapper template for all the views if 'Default Events Template'
* is selected in Events -> Settings -> Template -> Events Template.
*
* Override this template in your own theme by placing this file at [your-theme]/tribe-events/default-template.php
*
* @package TribeEventsCalendar
*
@sisaacrussell
sisaacrussell / functions.php
Last active February 21, 2017 14:36 — forked from skyshab/functions.php
rename custom taxonomy
add_action( 'init', 'my_modify_taxonomy', 11 );
function my_modify_taxonomy() {
// get the arguments of the already-registered taxonomy
$my_category_args = get_taxonomy( 'project_category' );
// make changes
$my_category_args->rewrite['slug'] = 'genre';
@sisaacrussell
sisaacrussell / functions.php
Created January 3, 2018 22:38 — forked from SJ-James/functions.php
Clear Local Storage Button For Divi
<?php
function ClearLocalCacheButton() { ?>
// Create Button
<a href="#" onclick="ClearLocalCache()" class="et-pb-layout-buttons et-pb-layout-buttons-cache" title="Clear Cache">
<span>Clear Cache</span>
</a>
<script type="text/javascript">
// Move Button to Divi Tabs
jQuery(window).load(function(){
@sisaacrussell
sisaacrussell / gw-gravity-forms-inventory.php
Created March 8, 2018 19:34 — forked from spivurno/gw-gravity-forms-inventory.php
Gravity Wiz // Gravity Forms // Better Inventory with Gravity Forms (aka Limit by Sum of Field Values)
<?php
/**
* Gravity Wiz // Gravity Forms // Better Inventory with Gravity Forms
*
* Implements the concept of "inventory" with Gravity Forms by allowing the specification of a limit determined by the
* sum of a specific field, typically a quantity field.
*
* @version 2.11
* @author David Smith <david@gravitywiz.com>
* @license GPL-2.0+
@sisaacrussell
sisaacrussell / etModules-icon-codes.css
Created March 22, 2018 13:00 — forked from SJ-James/etModules-icon-codes.css
A list of the codes for Divi's built in icon collection
/* example of use */
h1:before {
font-family: 'etModules';
content: "\24";
}
/* codes */
.arrow_up:before {
content: "\21";
@sisaacrussell
sisaacrussell / richsnippet.liquid
Created March 27, 2018 18:13 — forked from joe-dempsey/richsnippet.liquid
Shopify product richsnippet - structured data markup for Shopify product templates
{% assign current_variant = product.selected_or_first_available_variant %}
<div id="richsnippet">
<div itemscope itemtype="http://schema.org/Product">
<meta itemprop="url" content="{{ shop.url }}{{ product.url }}">
<meta itemprop="image" content="{{ product.featured_image.src | img_url: 'grande' }}">
<meta itemprop="name" content="{{ product.title | escape }}">
<meta itemprop="description" content="{{ product.description | strip_html }}">
{% if product.vendor %}<meta itemprop="brand" content="{{ product.vendor }}">{% endif %}
@sisaacrussell
sisaacrussell / mainwp-client-report-monthly.html
Created July 7, 2018 03:56 — forked from uamv/mainwp-client-report-monthly.html
HTML Text Used for MainWP Monthly Client Report
<table style="width: 600px; margin: 0 auto; padding: 0; border-spacing: 0; border-collapse: collapse;"><tbody><tr><td style="background: #040404; margin-top: 0; padding: 0;"><img style="display: block; border: 0; line-height: 1;" src="https://typewheel.xyz/share/typewheel-email-banner.png" alt="Typewheel" width="600" /></td></tr><tr><td style="padding: 2em; background-image: linear-gradient( to bottom, #D7D7D7, #E7D3BA);"><p style="margin: 0 2em 2em;">Hello [client.contact.nickname]! Here's an overview of the things I am doing to keep your site updated, optimized, and secure.</p><p style="text-align: center; margin: 0 0 1.5em;"><img style="display: block; margin: 0 auto .5em;" src="[client.logo.url]" alt="[client.name] Logo" height="100" /><span style="text-align: center; font-size: 28px;"><strong>[report.daterange]</strong></span><br /><span style="text-align: center; font-size: 28px;"><strong><a style="color: #040404; text-decoration: none;" href="[client.site.url]">[client.site.domain]</a></strong></span><
@sisaacrussell
sisaacrussell / functions.php
Last active July 3, 2020 05:36 — forked from vidishpurohit/gist:4973f69cc21ef34ca4271d26f38dacbf
add subtotal to edit order admin woocommerce
<?php
// Add to functions.php of your theme or child theme. Don't include the php tag above this line!
/**
* This code will add subtotal to the edit order admin in WooCommerce.
*
* @author Sprucely Designed <support@sprucely.net>
* @see https://github.com/woocommerce/woocommerce/issues/17172
* @param int $order_id Order ID retreived from db for order being displayed.
*/
@sisaacrussell
sisaacrussell / functions.php
Created May 1, 2019 16:21 — forked from xadapter/functions.php
Set default weight and Dimension for the products in a woocommerce store. Supports ELEX Shipping Plugins https://elextensions.com/product-category/shipping/ Useful for Woocommerce shipping plugins like below: https://www.xadapter.com/product/multiple-carrier-shipping-plugin-woocommerce/ https://www.xadapter.com/product/woocommerce-ups-shipping-p…
/**
* Snippet to set default weight and Dimension if it's not set for any product.
* Created at : 14 May 2018
* Updated at : 16 May 2018
* Xadapter Plugins : https://www.xadapter.com/shop/
* Gist Link : https://gist.github.com/xadapter/4fb8dbfc6c025630558e43488775eb7d
*/
// To set Default Length
add_filter( 'woocommerce_product_get_length', 'xa_product_default_length' );