Skip to content

Instantly share code, notes, and snippets.

View ericakfranz's full-sized avatar

Erica Franz ericakfranz

View GitHub Profile
@ericakfranz
ericakfranz / .htaccess
Last active March 5, 2021 18:30
WordPress .htaccess configuration file. Allows Forced SSL, Hide wp-config.php, Header ETags, GZIP Compression and Expires Caching.
## BEGIN Force SSL ##
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R=301,L]
## END Force SSL ##
## BEGIN WordPress ##
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
@ericakfranz
ericakfranz / envira-reload-click-on-load.php
Last active April 13, 2017 15:32 — forked from n7studios/envira-reload-click.php
Register a click handler to reload Envira Gallery layouts. Useful when an Envira Gallery isn't visible on page load.
<?php
/**
* Plugin Name: Envira Gallery - Reload Enviratope on Page Load
* Plugin URI: http://enviragallery.com
* Version: 1.0
* Author: Erica Franz
* Author URI: https://fatpony.me/
* Description: Reload Envira Gallery layouts when page finishes loading.
*/
@ericakfranz
ericakfranz / soliloquy_crop_image_args.php
Created January 29, 2015 20:45
Filter Soliloquy Crop Defaults
function soliloquy_crop_change_args( $args ) {
$args = array(
'position' => 'b', // crop position, b = bottom, c = center, t = top, default is center
'width' => '1200', // cropped image width
'height' => '300', // cropped image height
'quality' => 100, // cropped image quality
'retina' => true // make allowance for retina (produces cropped images at twice the dimension size set), default is false
);
@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 / optinmonster-user-role.php
Created February 21, 2015 03:47
Enable Editors to view/add/edit OptinMonster
add_filter( 'optin_monster_menu_cap', function( $cap ){
if ( current_user_can('delete_pages') ) {
return 'edit_pages';
}
});
@ericakfranz
ericakfranz / om-glot-condition.php
Created March 6, 2015 18:22
Display OptinMonster optins based on page language
add_filter( 'optin_monster_output', 'tgm_om_only_swedish', 100 );
function tgm_om_only_swedish( $optins ) {
// Your function to check for Swedish. Change as necessary.
if ( ! is_swedish() ) {
$optins = array();
}
return $optins;
@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 ) {