Skip to content

Instantly share code, notes, and snippets.

View lizardking8610's full-sized avatar

Robert lizardking8610

View GitHub Profile
@lizardking8610
lizardking8610 / changeButton.php
Created June 5, 2019 02:25
Elementor nofollow noopener
if ( $settings['link']['is_external'] ) {
$this->add_render_attribute( 'button', 'target', '_blank' );
}
if ( $settings['link']['nofollow'] ) {
$this->add_render_attribute( 'button', 'rel', 'nofollow' );
}
# Redirect Query String
<IfModule mod_rewrite.c>
RewriteCond %{REQUEST_URI} ^/specific/url/
RewriteCond %{QUERY_STRING} key=value
RewriteRule (.*) /path/ [R=301,L]
</IfModule>
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {
font-family: "Lato", sans-serif;
}
.sidenav {
:root {
font-size: 16px;
}
// Or you can use html
// html {
// font-size: 16px;
// }
body {
#header {
width: 100%;
height: 100%;
background: url(../img/yourpic.jpg) no-repeat fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
@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);
}
@lizardking8610
lizardking8610 / revinate.txt
Created May 28, 2019 18:33
Revinate API Documentation
Advanced Setup
For more advanced users, who may have web development resources, they can directly interface with the API and build to their own requirements. A developer would need to build the JSON elements and POST it to the endpoint provided. One way to familiarize with this is also to review how we did this in the sample via the HTML source and the JavaScript used within the sample described earlier.
End-point and Method
End-point: http://contact-api.inguest.com/api/add-contacts-to-lists
<script type="text/javascript" src="//contact-api.inguest.com/bundles/revinatecontactapi/js/revinate-form.js?v=1"></script>
<form id="revinate_contact_api_form" token="3f31d1dc-3bd8-4105-9ca7-45a66cf022b2"
onsubmit="revFormOnSubmit(); event.preventDefault();">
<fieldset>
<legend> Revinate Contact Sign Up Form Sample.</legend>
<div>
<label>Email</label>
<input class="long" type="email" name="email" required/> </div>
<div class="button">
<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>