Skip to content

Instantly share code, notes, and snippets.

View ericakfranz's full-sized avatar

Erica Franz ericakfranz

View GitHub Profile
@ericakfranz
ericakfranz / envira-pagination-css.css
Last active December 2, 2015 20:48
Envira Gallery Pagination CSS Structure
/* Pagination Container */
.envira-gallery-wrap .envira-pagination {
margin: 0 0 20px 0;
}
/* Current Page Item */
.envira-gallery-theme-subtle .envira-pagination span.current {
}
@ericakfranz
ericakfranz / envira-lightbox-self-hosted-video.html
Last active December 2, 2015 21:15
Example of link for loading self-hosted video in Envira's lightbox when using https://gist.github.com/ericakfranz/a470a198f3f4758c2f2c
<a href="http://example.com/wp-content/uploads/2015/12/video.mp4" data-envirabox-type="iframe">
<img src="http://example.com/wp-content/uploads/2015/12/image.jpg" alt="" height="" width="" />
</a>
@ericakfranz
ericakfranz / om-custom-redirect.js
Created December 3, 2015 16:19
Redirect the visitor to a specific URL when any optin is exited or successfully submitted.
jQuery(document).ready(function($){
function omRedirect() {
var url = "http://optinmonster.com";
$(location).attr('href',url);
}
$(document).on('OptinMonsterOptinSuccess', function(event, data, object){ omRedirect(); });
$(document).on('OptinMonsterOnClose', function(event, data, object){ omRedirect(); });
});
@ericakfranz
ericakfranz / om-custom-redirect-all-close.js
Created December 3, 2015 16:28
Custom Redirect for all optins on close using the OptinMonster event 'OptinMonsterOnClose'.
jQuery(document).ready(function($){
function omRedirect() {
var url = "http://optinmonster.com";
$(location).attr('href',url);
}
$(document).on('OptinMonsterOnClose', function(event, data, object){ omRedirect(); });
});
@ericakfranz
ericakfranz / om-custom-redirect-close.js
Last active January 27, 2016 18:01
Redirect when a specific optin is closed using the OptinMonster event 'OptinMonsterOnClose'.
jQuery(document).ready(function($){
function omRedirect() {
var url = "http://optinmonster.com";
$(location).attr('href',url);
}
$(document).on('OptinMonsterOnClose', function(event, data, object){
if(data.optin = 'YOUR_OPTIN_SLUG_HERE') {
omRedirect();
}
});
@ericakfranz
ericakfranz / envira-acf-dynamic-post-gallery.php
Created December 4, 2015 18:07
Get the IDs of all images attached to a post via ACF gallery field, and output to an Envira Gallery using the Dynamic Addon
<?php
$gallery = get_post_meta( get_the_ID(), 'gallery_images' ); // 'gallery_images' is name of the ACF gallery field
$post_id = get_the_ID(); // grab the ID of the post to build into our Dynamic gallery's custom ID
// If we have something output the gallery
if( isset( $gallery[0] ) && is_array( $gallery[0] )) {
$image_ids = $gallery[0];
envira_dynamic( array(
@ericakfranz
ericakfranz / om-monsterlink-wp-menu.php
Last active March 19, 2016 04:20
Add the required link attributes to a WordPress menu item using Javascript. Useful if the site uses a custom walker class.
@ericakfranz
ericakfranz / soliloquy-slider-image-overlay.css
Created December 7, 2015 18:30
Add an image overlaying a portion of the Soliloquy slider
.soliloquy-container .soliloquy-slider:before {
display: block;
content: '';
width: 50%;
height: 100%;
position: fixed;
right: 0;
z-index: 9;
background: url('http://www.360fashion.net/wp-content/uploads/2013/01/image-placeholder-500x500.jpg');
background-size: contain;
@ericakfranz
ericakfranz / om-use.js
Created December 7, 2015 21:42
Basic method of using an OptinMonster Event
jQuery(document).ready(function($){
$(document).on('EventName', function(event,data,object) {} );
});
@ericakfranz
ericakfranz / om-use-jquery.js
Created December 7, 2015 21:46
Basic method of using OptinMonster Events.
jQuery(document).ready( function($){
jQuery(document).on('EventName', function( event,data,object ) {} );
});