Skip to content

Instantly share code, notes, and snippets.

View ericakfranz's full-sized avatar

Erica Franz ericakfranz

View GitHub Profile
<?php
add_filter( 'optinmonster_output', 'limit_views' );
function limit_views ( $optins ) {
// Replace this with your optin slug
$optin_slug = 'yf3rluqqcj-lightbox';
// Replace this with the number of views
$view_limit = 100;
<?php
/**
* Plugin Name: Soliloquy - Output Custom Slider Item Attributes
* Plugin URI: http://soliloquywp.com
* Version: 1.0
* Author: Tim Carr
* Author URI: http://www.n7studios.co.uk
* Description: Add custom HTML attributes to Soliloquy Slider <img> elements
*/
@ericakfranz
ericakfranz / optinmonster-image-sizes.php
Last active August 29, 2015 14:14 — forked from thomasgriffin/gist:971e2ebc33118ea49bdc
Unset images sizes for all OptinMonster optin themes, install as plugin.
<?php
/**
* Plugin Name: OptinMonster Unset Images Sizes
* Plugin URI: http://optinmonster.com/
* Description: Disable the custom image sizes used in the OptinMonster themes. Optins will use full image size instead.
* Version: 1.0.0
* Author: Erica Franz
* Author URI: https://fatpony.me/
* License: GPL2
*/
@ericakfranz
ericakfranz / gist:a718b9090a146b5327cc
Last active August 29, 2015 14:14 — forked from thomasgriffin/gist:065903820d86889cbe85
Disable OptinMonster ajax requests to track optin impressions.
<?php // Do not include this opening tag.
add_filter( 'optin_monster_data', 'tgm_om_disable_tracking' );
function tgm_om_disable_tracking( $data ) {
$data['tracked'] = true;
return $data;
}
<?php
/**
* Plugin Name: Soliloquy - Inject Slides
* Plugin URI: http://soliloquywp.com
* Version: 1.0
* Author: Tim Carr
* Author URI: http://www.n7studios.co.uk
* Description: Disable touchswipe on mobile
*/
@ericakfranz
ericakfranz / custom-conversion-tracking.js
Last active August 29, 2015 14:15 — forked from thomasgriffin/gist:62689c45fa4bf7b6cb31
Custom action hook for custom conversion tracking in Canvas in OptinMonster.
jQuery(document).ready(function($){
$(document).on('click', '.om-custom-html-form a button', function(e){
// Prepare variables.
var $this = $(this),
optin = $this.closest('.optin-monster-overlay').attr('id').replace('om-', '').replace('-', '_');
if ( ! window[optin] ) {
return;
}
// Send ajax request to track the optin.
@ericakfranz
ericakfranz / optin-monster-query-limit.php
Last active August 29, 2015 14:17 — forked from thomasgriffin/gist:0ef000448c7cb5903587
Increase the post query limit for the Output tab setting by uploading this file as a plugin.
<?php
/**
* Plugin Name: OptinMonster Query Limit
* Description: Increases the default query limit for page-level targeting.
* Version: 1.0.0
*/
add_filter( 'optin_monster_post_selection_limit', 'tgm_om_post_selection_limit' );
function tgm_om_post_selection_limit( $limit ) {
@ericakfranz
ericakfranz / javascript_resources.md
Last active August 29, 2015 14:18 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage
@ericakfranz
ericakfranz / css_resources.md
Last active August 29, 2015 14:18 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides

<?php
add_filter( 'optin_monster_pre_optin_mailchimp', 'tgm_om_custom_mailchimp_data', 10, 4 );
/**
* Filter the data sent to Mailchimp.
*
* See here for more info on what is passed: https://apidocs.mailchimp.com/api/2.0/lists/subscribe.php
*
* @param array $data Array of data being sent to Mailchimp.
* @param array $lead Array of lead data captured from the optin submission.
* @param string $list_id The unique list ID to subscribe the lead to.