Skip to content

Instantly share code, notes, and snippets.

View steveclason's full-sized avatar

Steve Clason steveclason

View GitHub Profile
@steveclason
steveclason / History\-107d3e71\entries.json
Last active February 4, 2023 16:42
Visual Studio Code Settings Sync Gist
{"version":1,"resource":"file:///d%3A/Clients/InciteResponse/canvasyachtcharters/worklog.md","entries":[{"id":"Yjn5.md","timestamp":1663624601351},{"id":"qG3z.md","timestamp":1671296426482},{"id":"oIdV.md","timestamp":1672333334329},{"id":"exqU.md","timestamp":1672422848166},{"id":"Zqel.md","timestamp":1672424406401},{"id":"eBbI.md","timestamp":1672595763893},{"id":"8vN1.md","timestamp":1672849953819},{"id":"mmdn.md","timestamp":1672857745737},{"id":"SLZq.md","timestamp":1673200233612},{"id":"XbZ6.md","timestamp":1673200254067},{"id":"9co6.md","timestamp":1673200278973},{"id":"xz7U.md","timestamp":1673200318873},{"id":"m1bT.md","timestamp":1673200337263},{"id":"kcM9.md","timestamp":1673200350255},{"id":"QZ5E.md","timestamp":1673200450669},{"id":"f0wU.md","timestamp":1673200581613},{"id":"4gxF.md","timestamp":1673200621523},{"id":"516d.md","timestamp":1673200790951},{"id":"EqEw.md","timestamp":1673200910617},{"id":"Jgzq.md","timestamp":1673368382150},{"id":"xowd.md","timestamp":1673458820426},{"id":"YmAC.md","
@steveclason
steveclason / aggregate_files.php
Created May 26, 2016 21:57
Override Header Layout in Avada Child Theme
<?php
/* Override (modify) the Avada header layouts in a child theme by establishing a local version. */
/* Avada has 6 header layouts selectable via Avada > Theme Options > Header > Header Content. These map to files at
"/wp-content/themes/Avada/templates". You can use your browser's devtools to look in the header for something like
'<div class="fusion-header-v1 ... ">' which will help identify what's being used, if you don't already know.
*/
// Copy this block from "/wp-content/themes/Avada/templates/header.php". If you are not using header_1 then copy the appropriate block.
if ( ! function_exists( 'avada_header_1' ) ) {
@steveclason
steveclason / functions.php
Created September 6, 2021 20:21
LearnDash, WordPress, add serial number to certificate.
<?php
/**
* LearnDash in WordPress
* Display a serial number on the printed course certificate. Serial number is a concatenation of user_id abd certificate_id.
* Attribute stuff is there just in case, does nothing now.
* I usually put shortcodes in a shortcodes.php file and require it in functions.php, but whatever.
*/
if ( !function_exists ( 'ce_cert_serialize_function' )) {
function ce_cert_serialize_function( $atts ) {
@steveclason
steveclason / cart-shipping.php
Last active September 17, 2018 17:02
Woocommerce Enable/Disable Shipping Methods
<?php
/**
* Shipping Methods Display
*
* In 2.1 we show methods per package. This allows for multiple methods per order if so desired.
*
* This template can be overridden by copying it to yourtheme/woocommerce/cart/cart-shipping.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
@steveclason
steveclason / functions.php
Created January 8, 2017 20:50
WordPress, defer loading of specific script(s).
// script_loader_tag is new as of WP 4.1
add_filter( 'script_loader_tag', function ( $tag, $handle ) {
if ( 'contact-form-7' !== $handle )
return $tag;
return str_replace( ' src', ' defer="defer" src', $tag );
}, 10, 2 );
<?php
/*
* Print a list of active WordPress Plugins.
* Put this in a template file you can see or hide it and use DevTools to view it.
* Useful for troubleshooting perfomance problems in sites with many plugins.
*/
// Check if get_plugins() function exists. This is required on the front end of the
// site, since it is in a file that is normally only loaded in the admin.
if ( ! function_exists( 'get_plugins' ) ) {