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 / style.css
Last active October 18, 2018 07:56
Vertically align Divi modules within a row using a custom class
/*
* Custom class to vertically align modules within a row
* Add to Custom CSS tab of module within the page
*/
.ds-vertical-align {
display: flex;
flex-direction: column;
justify-content: center;
}
.ds-bottom-align {
@sisaacrussell
sisaacrussell / custom.css
Last active February 27, 2017 20:00
Pagination styling for Divi filterable portfolios.
/*
Pagination styling for portfolios.
*/
.et_pb_filterable_portfolio .et_pb_portofolio_pagination ul li {
display: inline-block;
}
.et_pb_filterable_portfolio .et_pb_portofolio_pagination ul li a {
float: left;
padding: 8px 16px;
@sisaacrussell
sisaacrussell / tribe-events.css
Last active July 11, 2020 12:00
Custom CSS for Tribe Events Plugin
/*
*
* Custom CSS for Tribe Events Plugin
*
*/
/* Ticket page styling */
.tribe-rsvp-message-success {
background-color: #dff7dd;
@sisaacrussell
sisaacrussell / functions.php
Created April 11, 2017 13:05
Tribe Events Tickets - Limit RSVP to 1 per event
/*
* Tribe, limit ticket qty
* Source: https://theeventscalendar.com/support/forums/topic/only-one-ticket-per-person/
*/
function tribe_limit_tickets() {
?>
<script type="text/javascript">
jQuery(document).ready( function( $ ) {
// do this if tickets available
/*
* Enable option within Gravity Forms to hide form field labels
* Source: https://gravitywiz.com/how-to-hide-gravity-form-field-labels-when-using-placeholders/
*/
add_filter( 'gform_enable_field_label_visibility_settings', '__return_true' );
@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+