Skip to content

Instantly share code, notes, and snippets.

View ericakfranz's full-sized avatar

Erica Franz ericakfranz

View GitHub Profile
<form id="campaign-{{id}}" novalidate class="{{ns}}" method="POST" action="submit.php">
<input id="name" type="text" placeholder="First and Last Name" required />
<input id="email" type="email" placeholder="Email" required />
<span class="error"></span>
<input type="submit" name="submit" value="Submit" />
</form>
<script>
(function() {
const form = document.getElementById('campaign-{{id}}');
@ericakfranz
ericakfranz / custom-html-js-validation-example.html
Last active May 19, 2021 16:43
Example of a Custom HTML form with Javascript validation for OptinMonster
<form id="campaign-{{id}}" novalidate class="{{ns}}" method="POST" action="submit.php">
<input id="name" type="text" placeholder="First and Last Name" required />
<input id="email" type="email" placeholder="Email" required />
<span class="error"></span>
<input type="submit" name="submit" value="Submit" />
</form>
<script>
(function() {
const form = document.getElementById('campaign-{{id}}');
@ericakfranz
ericakfranz / OM-non-business-email.js
Last active October 11, 2019 15:41 — forked from thomasgriffin/gist:891c405de8b6475a6772
Redirect any non-business email addresses to a custom page.
jQuery(document).ready(function($){
$(document).on('om.Campaign.load', function(e, data){
// Grab the email address submitted by the user.
var email = $('#om-' + data.optin).find('input[type="email"]').val();
// Test to ensure it is a proper email. Otherwise, redirect to another page.
if ( /@yahoo\.com$/.test(email) || /@gmail\.com$/.test(email) || /@hotmail\.com$/.test(email) || /@googlemail\.com$/.test(email) || /@live\.com$/.test(email) || /@aol\.com$/.test(email) || /@outlook\.com$/.test(email) || /@comcast\.net$/.test(email) || /@inbox\.com$/.test(email) || /@hushmail\.com$/.test(email) || /@lycos\.com$/.test(email) || /@zoho\.com$/.test(email) || /@gmx\.com$/.test(email) ) {
window[data.optin_js].optin = function(){
return window.location.href = 'https://optinmonster.com/';
};
@ericakfranz
ericakfranz / monsterlink-new-url-tab.html
Last active July 15, 2019 22:19
MonsterLink then open URL in new tab
@ericakfranz
ericakfranz / envira-gallery-remove-media-button.php
Created September 3, 2017 04:09
Remove the Add Gallery button on post / page edit screen.
@ericakfranz
ericakfranz / enfold-theme-hover-fix.php
Created August 23, 2017 03:51
Fix Enfold theme's hover action on Envira gallery images
add_filter('envira_gallery_output_before_image', 'enfold_envira_gallery_output_before_image', 10, 5);
function enfold_envira_gallery_output_before_image( $output, $id, $item, $data, $i ) {
$output = str_replace('envira-gallery-link', 'envira-gallery-link noHover', $output);
return $output;
}
@ericakfranz
ericakfranz / envira-gallery-tags-dropdown.js
Created August 23, 2017 03:28
Display tags filter list as a dropdown field for Envira Gallery.
@ericakfranz
ericakfranz / force-download.php
Created August 21, 2017 20:53
Force Downloads by setting the correct mime type.
/**
* Force Download
*
* Generates headers that force a download to happen
* Example usage:
* force_download( 'screenshot.png', './images/screenshot.png' );
*
* @access public
* @param string $filename
* @param string $data
@ericakfranz
ericakfranz / om-inline-prioritizer.php
Created August 2, 2016 16:19
Simple change to the OptinMonster default priority for inline optins.
<?php
/**
* Plugin Name: OM Inline Prioritizer
* Version: 1.0
* Description: Simple change to the OptinMonster default priority for inline optins.
* Author: Devin Vinson
* Author URI: http://optinmonster.com
* Text Domain: om-inline-prioritizer
* Domain Path: /languages
* @package om-inline-prioritizer
@ericakfranz
ericakfranz / envira-breadcrumbs.css
Created March 17, 2016 19:45
Envira Breadcrumbs Addon css selectors for custom styling.
/* Style the breadcrumbs container */
.envira-breadcrumbs { }
/* Style the breadcrumb links */
.envira-breadcrumbs a { }
/* Style the last breadcrumb item */
.envira-breadcrumbs span.breadcrumb_last { }