Skip to content

Instantly share code, notes, and snippets.

View ericakfranz's full-sized avatar

Erica Franz ericakfranz

View GitHub Profile
@ericakfranz
ericakfranz / soliloquy-lightbox.php
Last active August 29, 2015 14:10
Soliloquy - Lightbox Link Captions
/**
* Plugin Name: Soliloquy - Lightbox Link Captions
* Plugin URI: http://soliloquywp.com
* Version: 1.0
* Author: Erica Franz
* Author URI: http://fatpony.me
* Description: Link captions to image and open in lightbox.
*/
/**
@ericakfranz
ericakfranz / envira-titles-below-thumbnails.php
Last active July 29, 2017 06:20
Display image title below thumbnails in Envira Gallery
/**
* Plugin Name: Envira Gallery - Image Titles below Thumbnails
* Plugin URI: http://enviragallery.com
* Version: 1.0
* Author: Erica Franz
* Author URI: http://fatpony.me/
* Description: Display titles below images
*/
function envira_gallery_image_titles( $output, $id, $item, $data, $i ) {
@ericakfranz
ericakfranz / om-author-archive.php
Created December 29, 2014 19:58
Load OptinMonster optin on author archive only
add_filter( 'optin_monster_output', 'ekf_om_modify_output', 10, 2 );
function ekf_om_modify_output( $init, $optin ) {
// Replace 'optin-slug' with your own optin slug which can be found in the OptinMonster Overview list
if ( is_author() ) {
$init['optin-slug'] = Optin_Monster_Output::get_instance()->get_optin_monster( $optin->ID );
}
return $init;
}
@ericakfranz
ericakfranz / soliloquy-titled-caption.php
Last active August 29, 2015 14:12
Add Soliloquy slide title to caption output
/**
* Plugin Name: Soliloquy - Titled Captions
* Plugin URI: http://soliloquywp.com
* Version: 1.0
* Author: Erica Franz
* Author URI: http://fatpony.me/
* Description: Add Soliloquy slide title to caption output
*/
/**
@ericakfranz
ericakfranz / soliloquy-globally-titled.php
Last active August 29, 2015 14:13
Output Title of Soliloquy Slider before images and container.
/**
* Plugin Name: Globally Titled Soliloquy
* Plugin URI: http://soliloquywp.com
* Version: 1.0
* Author: Erica Franz
* Author URI: http://fatpony.me/
* Description: Display Soliloquy Slider Title before slider - globally.
*/
add_filter( 'soliloquy_output_start', 'ekf_titled_soliloquy', 10, 2 );
<?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 / soliloquy-image-dimensions.php
Last active August 29, 2015 14:14
Output specific image dimensions to Soliloquy slides, based on slider ID
/**
* Plugin Name: Soliloquy - Output Specific Images Sizes Based on Slider ID
* Plugin URI: http://soliloquywp.com
* Version: 1.0
* Author: Erica Franz
* Author URI: http://fatpony.me/
* Description: Output specific image dimensions to Soliloquy slides, based on slider ID
*/
/**
@ericakfranz
ericakfranz / defer-parsing-js-optinmonster.php
Last active February 11, 2019 02:34
Defer Parsing of JavaScripts for WordPress
//* Defer parsing of JavaScripts, but exclude OptinMonster!
function defer_parsing_of_js ( $url ) {
if ( FALSE === strpos( $url, '.js' ) ) return $url;
if ( strpos( $url, 'jquery.js' ) || strpos( $url, 'optinmonster' ) ) return $url;
return "$url' defer='defer";
}
add_filter( 'clean_url', 'defer_parsing_of_js', 11, 1 );
@ericakfranz
ericakfranz / remove-version-query-string.php
Created January 24, 2015 19:53
Remove version query string from WordPress files.
//* Remove version number from js and css files, keep other variables intact.
function remove_cssjs_ver( $src ) {
if( strpos( $src, '?ver=' ) )
$src = remove_query_arg( 'ver', $src );
return $src;
}
add_filter( 'style_loader_src', 'remove_cssjs_ver', 10, 2 );
add_filter( 'script_loader_src', 'remove_cssjs_ver', 10, 2 );