Skip to content

Instantly share code, notes, and snippets.

View bozzmedia's full-sized avatar

Bozz bozzmedia

View GitHub Profile
<?php
/**
* == About this Gist ==
*
* Code to add to wp-config.php to enhance information available for debugging.
*
* You would typically add this code below the database, language and salt settings
*
* Oh.. and *do* make sure you change the path to the log file to a proper file path on your server (make sure it exists).
*
@srikat
srikat / style.css
Last active September 10, 2018 23:03
How to edit Altitude Pro's style.css to fix the background images' loading problem. https://sridharkatakam.com/how-to-edit-altitude-pros-style-css-to-fix-the-background-images-loading-problem/
.front-page-2,
.front-page-3,
.front-page-4,
.front-page-5,
.front-page-6,
.front-page-7 {
border-top: 54px solid transparent;
margin-top: -54px;
-webkit-background-clip: padding-box;
-moz-background-clip: padding;
@loorlab
loorlab / disable_zlib.output_compression
Last active March 30, 2021 12:35
Disable zlib.output_compression on WordPress : Notice: ob_end_flush(): failed to send buffer of zlib output compression (1) in /path/wp-includes/functions.php on line 3282 via https://core.trac.wordpress.org/ticket/18525
SOLUTIONS I have came across so far:
======================== SOLUTION 1 ====================
In plugins (or somewhere) you probably have this code:
ini_set('zlib.output_compression', '1');
so, I replaced that code with
@rqreyes
rqreyes / .htaccess
Last active November 22, 2017 01:00 — forked from cmg-jess/Page Speed Insights
leverage browser caching and enable gzip compression
## LEVERAGE BROWSER CACHING ##
## https://gtmetrix.com/leverage-browser-caching.html ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType text/css "access plus 1 month"
ExpiresByType application/pdf "access plus 1 month"
@octalmage
octalmage / custom_timeout.php
Created July 14, 2016 18:38
PHP Compatibility Custom Timeout
<?php
/*
Plugin Name: PHP Compatibility Custom Timeout
*/
function custom_timeout( $timeout ) {
return 0;
}
add_filter( 'wpephpcompat_scan_timeout', 'custom_timeout', 10 );
@spivurno
spivurno / gw-gravity-forms-advanced-conditional-logic.php
Last active June 5, 2024 15:38
Gravity Wiz // Gravity Forms // Advanced Conditional Logic
<?php
/**
* Gravity Wiz // Gravity Forms // Advanced Conditional Logic
*
* PLEASE NOTE: This snippet is a proof-of-concept. It is not supported and we have no plans to improve it.
*
* Allows multiple groups of conditional logic per field.
*
* @version 0.1
* @author David Smith <[email protected]>
<?php
// CREDIT: http://pastebin.com/Ju78M8Ax
// exclude field from {all_fields} merge tag by adding
// :exclude to merge tag
add_filter( 'gform_merge_tag_filter', 'exclude_from_all_fields', 10, 4 );
function exclude_from_all_fields ( $value, $merge_tag, $options, $field ) {
$options_array = explode ( ",", $options );
$exclude = in_array ( "exclude", $options_array );
// if a field has the CSS Class Name gf_exclude the field will be excluded from the {all_fields:exclude} merge tag
@zackkatz
zackkatz / gravityview-body-class.php
Created May 24, 2018 00:32
GravityView - Add body classes when View is being rendered
<?php
/**
* Add body class for GravityView contexts
*/
add_filter('body_class', function( $classes = array() ) {
if ( ! class_exists( '\GV\View_Collection' ) ) {
return $classes;
}
@BruceMcKinnon
BruceMcKinnon / gform-sections-accordion.js
Last active January 7, 2025 11:18
Collapsible Gravity Form Sections
/*
This JS creates collapsible Gravity Form sections breaks
IMPORTANT:
1 - Within the Gravity form, you must add the class collapsible to each section break.
2 - All fields within those section breaks must have the class collapsible_field
3 - You must include both the CSS and the JS
@westonruter
westonruter / amp-gravity-forms-submission-shim.php
Last active September 5, 2024 01:58
AMP shim support for Gravity Forms submissions
<?php
/**
* AMP Gravity Forms Submission Shim plugin bootstrap.
*
* @package Google\AMP_Gravity_Forms_Submission_Shim
* @author Weston Ruter, Google
* @license GPL-2.0-or-later
* @copyright 2020 Google Inc.
*
* @wordpress-plugin