Skip to content

Instantly share code, notes, and snippets.

View ericakfranz's full-sized avatar

Erica Franz ericakfranz

View GitHub Profile
@ericakfranz
ericakfranz / om-unload-jquery.js
Created November 18, 2015 18:58
OptinMonster loads jQuery v1.11.3 by default, use this to remove this function. Useful if the site is already loading a different version of jQuery and the page source is outputting multiple copies. One version for WP users, the other as plain JS.
<script type="text/javascript">
var om_load_jquery = false;
</script>
@ericakfranz
ericakfranz / optin-monster-keystroke-exit.js
Created November 24, 2015 15:58
Assign the escape key to exit an optin. ikhc6rkql15ly9mx = optin's slug
$(document).keyup(function(e) {
if (e.keyCode == 27) { // escape key maps to keycode `27`
if( typeof window.ikhc6rkql15ly9mx !=='undefined') {
window.ikhc6rkql15ly9mx.close(true);
}
}
});
@ericakfranz
ericakfranz / genesis-facebook-sdk.php
Created November 24, 2015 23:39
Easily include the Facebook SDK script, useful when adding Facebook Social Plugins to your site: https://developers.facebook.com/docs/plugins
<?php
/**
* Plugin Name: Genesis - Facebook SDK
* Plugin URI: https://fatpony.me/
* Description: Adds the Facebook SDK script just after the opening <body> tag on Genesis Framework sites.
* Version: 1.0.0
* Author: Erica Franz
* Author URI: https://fatpony.me/
* License: GPL2
*/
@ericakfranz
ericakfranz / om-hover-monsterlink-trigger-optin.js
Created November 27, 2015 20:41
Trigger a click on a MonsterLink when hovered over.
@ericakfranz
ericakfranz / om-hover-external-link-trigger-optin.js
Created November 27, 2015 20:51
Trigger a click on a specific MonsterLink when hovering over any link containing the rel="external" attribute.
@ericakfranz
ericakfranz / om-hover-element-trigger-optin.js
Created November 27, 2015 20:53
Trigger a click on a specific MonsterLink when hovering over a specific element on the page.
jQuery(document).ready(function($){
$('.content').live('mouseover', function() { // When hovering over any element with the '.content' class - change as you require
$('.manual-optin-trigger[data-optin-slug=u6mkwuqm0xf6g94d]').trigger('click'); // Change 'u6mkwuqm0xf6g94d' to match your specific optin slug
});
});
@ericakfranz
ericakfranz / om-image-nopin-attribute.js
Last active March 22, 2016 15:59
Add the data-pin-nopin attribute to popup optin images to exclude them from Pinterest share options. https://developers.pinterest.com/docs/widgets/pin-it/#nopin
jQuery(document).ready(function($) {
$(document).on('OptinMonsterLoaded', function(event, data, object){
$('#om-' + data.optin + ' img').attr('data-pin-nopin', 'true');
});
});
@ericakfranz
ericakfranz / soliloquy-video-play-icon.css
Created November 30, 2015 21:54
Modify the default play icon for Soliloquy Video Slides
.soliloquy-container .soliloquy-video-icon {
background-image: url('http://www.example.com/image.png') !important;
background-size: 50% 50% !important;
}
/* Retina version */
@media only screen and (-webkit-min-device-pixel-ratio: 2),
only screen and (min--moz-device-pixel-ratio: 2),
only screen and (-o-min-device-pixel-ratio: 2 / 1),
only screen and (min-device-pixel-ratio: 2),
@ericakfranz
ericakfranz / om-custom-error-messages.js
Created December 1, 2015 16:56
Customize the error messages shown for the email and name input fields for OptinMonster when using any native Email Service Provider integration. Can be used to translate the message shown as well.
jQuery(document).ready(function($){
jQuery(document).on('OptinMonsterBeforeShow', function(event, props, object) {
object.setProp('email_error', 'Replace this text with your custom email field error message');
object.setProp('name_error', 'Replace this text with your custom name field error message');
});
});
@ericakfranz
ericakfranz / envira-lightbox-custom-images.php
Last active November 20, 2018 22:38 — forked from n7studios/envira-lightbox-custom-images.php
Envira Gallery - Lightbox for Custom Images
<?php
/**
* Plugin Name: Envira Gallery - Lightbox for Custom Images
* Plugin URI: http://enviragallery.com
* Version: 2.0
* Author: Erica Franz
* Author URI: https://fatpony.me/
* Description: Use the Envira Gallery lightbox for non-gallery images throughout your site.
*/