Skip to content

Instantly share code, notes, and snippets.

View bozzmedia's full-sized avatar

Bozz bozzmedia

View GitHub Profile
@johnbuck
johnbuck / change-projects-columns.php
Created May 29, 2014 05:27
Change the number of columns displayed by the Projects by WooThemes plugin
add_filter( 'projects_loop_columns', 'change_projects_columns', 99 );
function change_projects_columns( $columns ) {
$cols = 3;
return $columns;
}
@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"
<?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
@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;
@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 );
<?php
function reorder_admin_menu( $menu_items ) {
// Our top level items
$top_level = array();
// Post Types
$post_types = array();
// Our bottom level items
$bottom_level = array();
// And our penalty box...known that we want last
@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;
}
@spivurno
spivurno / gw-gravity-forms-disable-submit.php
Last active March 24, 2021 14:40
Gravity Wiz // Gravity Forms // Disable Submit Button Until Required Fields are Field Out
<?php
/**
* WARNING! THIS SNIPPET MAY BE OUTDATED.
* The latest version of this snippet can be found in the Gravity Wiz Snippet Library:
* https://github.com/gravitywiz/snippet-library/blob/master/gravity-forms/gw-disable-submit-button-until-required-fields-are-filled-out.php
*/
/**
* Gravity Wiz // Gravity Forms // Disable Submit Button Until Required Fields are Field Out
*
* Disable submit buttones until all required fields have been filled out. Currently only supports single-page forms.
@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
@grtaylor2
grtaylor2 / Change Read More Text Genesis WordPress
Last active August 11, 2021 19:53
Change the [Read More] Text in Genesis WordPress Child Theme
/** Customize Read More Text */
add_filter( 'excerpt_more', 'child_read_more_link' );
add_filter( 'get_the_content_more_link', 'child_read_more_link' );
add_filter( 'the_content_more_link', 'child_read_more_link' );
function child_read_more_link() {
return '<a href="' . get_permalink() . '" rel="nofollow">CUSTOMIZE YOUR TEXT HERE</a>';
}