Skip to content

Instantly share code, notes, and snippets.

View anythinggraphic's full-sized avatar
☺️
Be the reason someone smiles today.

Kevin Donnigan anythinggraphic

☺️
Be the reason someone smiles today.
View GitHub Profile
@anythinggraphic
anythinggraphic / add_woocom_support
Created March 16, 2021 16:11 — forked from feastdesignco/add_woocom_support
Adds back in woocommerce functionality removed from Feast themes 4.1.5+ - not tested
// Add support for WooCommerce features.
add_theme_support( 'woocommerce' );
add_theme_support( 'wc-product-gallery-lightbox' );
add_theme_support( 'wc-product-gallery-slider' );
add_theme_support( 'wc-product-gallery-zoom' );
if ( class_exists( 'WooCommerce', false ) ) {
require_once FEAST_DIR . 'lib/woocommerce.php'; // note: doesn't exist anymore
}
@anythinggraphic
anythinggraphic / gw-gravity-forms-unrequire-required-fields-usage.php
Last active February 27, 2021 01:35 — forked from spivurno/gw-gravity-forms-unrequire-required-fields-usage.php
Gravity Wiz // Gravity Forms Unrequire Required Fields for Speedy Testing
<?php
# Basic Usage
# requires that the user be logged in as an administrator and that a 'gwunrequire' parameter be added to the query string
# http://youurl.com/your-form-page/?gwunrequire=1
new GWUnrequire();
# Enable for All Users (Including Visitors)
# still requires the 'gwunrequire' parameter be added to the query string
new GWUnrequire( array(
@anythinggraphic
anythinggraphic / php-style-guide.md
Created January 14, 2021 17:17 — forked from ryansechrest/php-style-guide.md
PHP style guide with coding standards and best practices.

PHP Style Guide

All rules and guidelines in this document apply to PHP files unless otherwise noted. References to PHP/HTML files can be interpreted as files that primarily contain HTML, but use PHP for templating purposes.

The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.

Most sections are broken up into two parts:

  1. Overview of all rules with a quick example
  2. Each rule called out with examples of do's and don'ts
@anythinggraphic
anythinggraphic / functions.php
Created November 16, 2016 22:34 — forked from Deaner666/functions.php
Add customized 'read more' links to hand crafted excerpts
<?php
/* Add "Read More" link to hand-crafted excerpts
----------------------------------------------------------------------------------------*/
add_filter('get_the_excerpt', 'ag_manual_excerpt_read_more_link');
function ag_manual_excerpt_read_more_link($excerpt) {
$excerpt_more = '';
if (has_excerpt() && ! is_attachment() && get_post_type() == 'post') {
$excerpt_more = '&nbsp;<a href="' . get_permalink() . '">[Continue&nbsp;reading] <span class="screen-reader-text">' . get_the_title() . '</span></a>';
}