Skip to content

Instantly share code, notes, and snippets.

View lizardking8610's full-sized avatar

Robert lizardking8610

View GitHub Profile
@lizardking8610
lizardking8610 / embed-form.php
Created May 29, 2019 14:28 — forked from cdils/embed-form.php
Add a Gravity Forms to a single AgentPress Listings post and dynamically populate the form with the post title. Add this to functions.php.
<?php //remove this line
/**
* Enqueue scripts for a specified Gravity Form (13 = ID) and then
* embed Gravity Form at the bottom of single property listings
*
* http://www.gravityhelp.com/documentation/page/Gform_enqueue_scripts
* http://www.gravityhelp.com/documentation/page/Embedding_A_Form#Function_Call
*
* @author Carrie Dils
@lizardking8610
lizardking8610 / Gravity_Forms_API_POST
Created May 29, 2019 14:25
Gravity Forms API POST example
<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.2/rollups/hmac-sha1.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.2/components/enc-base64-min.js"></script>
<script type="text/javascript">
function CalculateSig(stringToSign, privateKey){
//calculate the signature needed for authentication
var hash = CryptoJS.HmacSHA1(stringToSign, privateKey);
var base64 = hash.toString(CryptoJS.enc.Base64);
return encodeURIComponent(base64);
}
<script type="text/javascript" src="//contact-api.inguest.com/bundles/revinatecontactapi/js/revinate-form.js"></script>
<form id="revinate_contact_api_form" token="00000000-0000-0000-0000-0000000000000" onsubmit="revFormOnSubmit(); event.preventDefault();">
<style scoped>
label {display:inline-block; width:130px;}
label.required:after { content:" *"; color: red;}
fieldset {width:500px; padding:1em; border:3px solid #CCC;}
input {margin: 1px 5px 1px 5px; width:145px; padding: 3px; border-width: 2px;}
input.long {width: 300px}
div.button {margin-top: 1em; text-align: center;}
</style>
/**
* Get the host of the this script. The host will be used for posting the data.
*/
var getHost = function () {
var scripts = document.getElementsByTagName("script");
var i;
for (i = 0; i < scripts.length; i++) {
var urlAttribute = scripts[i].attributes.getNamedItem("src");
if (urlAttribute) {
var url = urlAttribute.nodeValue;
@lizardking8610
lizardking8610 / modernizr_enqueue
Created May 23, 2019 21:36 — forked from zslabs/modernizr_enqueue
Enqueue Modernizr before all other scripts
function basey_scripts_header() {
wp_enqueue_script('modernizr', get_template_directory_uri() . '/js/modernizr.foundation.js', '', null, false);
}
add_action('template_redirect','basey_scripts_header', 8);
@lizardking8610
lizardking8610 / functions.php
Created May 23, 2019 20:45 — forked from wpscholar/functions.php
Enqueueing IE conditional stylesheets in WordPress the right way
<?php
add_action( 'wp_enqueue_scripts', 'enqueue_my_styles' );
/**
* Example callback function that demonstrates how to properly enqueue conditional stylesheets in WordPress for IE.
* IE10 and up does not support conditional comments in standards mode.
*
* @uses wp_style_add_data() WordPress function to add the conditional data.
* @link https://developer.wordpress.org/reference/functions/wp_style_add_data/
" Make IE Better Compatible "
<!--[if IE]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
======================================================
IE6 Only
==================
_selector {...}
add_action( 'wp_enqueue_scripts', 'generate_remove_fontawesome', 100 );
function generate_remove_fontawesome() {
wp_dequeue_style( 'fontawesome' );
}
@lizardking8610
lizardking8610 / acf-field-group-schema.json
Created May 9, 2019 22:12 — forked from friartuck6000/acf-field-group-schema.json
JSON schema for Advanced Custom Fields (ACF) field groups
{
"$schema": "http://json-schema.org/schema#",
"id": "http://advancedcustomfields.com/json-schema/field_group",
"type": "object",
"definitions": {
"empty": {
"type": "string",
"maxLength": 0
},
"intOrEmpty": {
<?php
add_action( 'genesis_meta', 'agency_home_genesis_meta' );
/**
* Add widget support for homepage. If no widgets active, display the default loop.
*
* Link http://wpsites.net/web-design/add-widget-home-php-genesis/
*/
function agency_home_genesis_meta() {