This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// file_get_contents wrapper to allow self-signed certs for local dev domains | |
function contextual_file_get_contents( $url ) { | |
$server_name = (isset($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : ''; | |
$localext = '.local'; | |
if ($server_name && substr($server_name, -strlen($localext)) === $localext) { | |
$context = stream_context_create(['ssl' => [ | |
'verify_peer_name'=>false, | |
'verify_peer'=>false, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// trim excerpt whitespace | |
if ( !function_exists( 'mp_trim_excerpt_whitespace' ) ) { | |
function mp_trim_excerpt_whitespace( $excerpt ) { | |
return trim( $excerpt ); | |
} | |
add_filter( 'get_the_excerpt', 'mp_trim_excerpt_whitespace', 1 ); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php defined('ABSPATH') or die; | |
/** | |
* Plugin Name: Page-Specific CSS | |
* Plugin URI: https://mindpalette.com | |
* Description: Add meta box for page-specific CSS using CodeMirror | |
* Version: 1.0 | |
* Author: Nate Baldwin | |
* Author URI: https://mindpalette.com | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
// add as HTML field type in Gravity Forms | |
// source: https://docs.gravityforms.com/gform_format_option_label/#usage | |
function gform_format_option_label(fullLabel, fieldLabel, priceLabel, selectedPrice, price, formId, fieldId) { | |
priceLabel = " <span class='ginput_price'>" + gformFormatMoney(price) + '</span>'; | |
return fieldLabel + priceLabel; | |
} | |
</script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RewriteEngine On | |
RewriteCond %{HTTP:X-Forwarded-Proto} !https | |
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).ready(function($) { | |
// specify the header element (used for offset height and fixed positioning check) | |
var fixedheader = $("#top-banner-navbar"); | |
// trigger for links with class scroll-offset-header | |
$(document).on("click", ".scroll-offset-header", function(e) { | |
if ($(fixedheader).css("position") === "fixed") { | |
e.preventDefault(); | |
e.stopImmediatePropagation(); |