Skip to content

Instantly share code, notes, and snippets.

@BronsonQuick
BronsonQuick / gravity_form_elements.xml
Created April 8, 2013 05:04
If you're using your own Gravity Forms CSS styling then import this xml file into your WordPress site to see if you've styled all of the Gravity Form fields and labels correctly.
<?xml version="1.0" encoding="UTF-8"?>
<forms version="1.6.12">
<form labelPlacement="top_label" useCurrentUserAsAuthor="1">
<title><![CDATA[GF Form 1 Test - Top aligned labels, Descriptions below inputs]]></title>
<description><![CDATA[We would love to hear from you! Please fill out this form and we will get in touch with you shortly.]]></description>
<confirmation type="message">
<message><![CDATA[Thanks for contacting us! We will get in touch with you shortly.]]></message>
</confirmation>
<button type="text">
<text><![CDATA[Submit]]></text>
@dustyf
dustyf / gist:5862035
Created June 25, 2013 20:26
Woo Commerce Dropdown to filter product tag within an archive page.
<?php
function displayLocationDropdown() {
$html = '';
$html .= '<form class="location-select" method="post">';
$html .= '<select id="location-selector" name="location" class="location">';
$tag = wp_tag_cloud( array(
'format' => 'array',
@hissy
hissy / nav-menu-exporter-importer.php
Last active August 13, 2023 17:06
[WordPress Plugin] Nav Menu Exporter and Importer / Export and Import nav menus. Requires WordPress Importer plugin.
<?php
/*
Plugin Name: Nav Menu Exporter and Importer
Description: Export and Import nav menus. Requires WordPress Importer plugin
Author: hissy, megumi themes
Version: 0.1
Text Domain: nav-menu-exporter-importer
License: GPL version 2 or later - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*/
@cliffordp
cliffordp / pagelines-dms-force-ssl-https-wp-engine.php
Last active February 12, 2017 16:38
PageLines DMS Force SSL/HTTPS
<?php
/*
Plugin Name: PageLines DMS Force SSL/HTTPS (for WP Engine)
Author: TourKick (Clifford P)
Author URI: http://tourkick.com/?utm_source=pagelines&utm_medium=plugin&utm_content=pluginuri&utm_campaign=dmsforcessl
Plugin URI: http://www.pagelinestheme.com/pagelines-dms-ssl-https/?utm_source=pagelines&utm_medium=plugin&utm_content=pluginuri&utm_campaign=dmsforcessl
Description: Force PageLines DMS SSL/HTTPS. <a href="http://www.pagelinestheme.com/pagelines-dms-ssl-https/" target="_blank">http://www.pagelinestheme.com/pagelines-dms-ssl-https/</a> may also be helpful.
License: GPLv2
Version: 1.2
*/
<?php
add_filter( 'pl_opt-textbox_title', 'hack_title' );
function hack_title( $opt ) {
global $post;
if( 4125 == $post->ID )
return 'Hello World!';
else
return $opt;
}
@srikat
srikat / functions.php
Last active February 8, 2022 20:06
Magnifying glass icon font using Dashicons for Search button in Genesis. http://sridharkatakam.com/add-magnifying-glass-icon-font-using-dashicons-search-button-genesis/
//* Enqueue Dashicons
add_action( 'wp_enqueue_scripts', 'enqueue_dashicons' );
function enqueue_dashicons() {
wp_enqueue_style( 'dashicons' );
}
//* Customize search form input button text
add_filter( 'genesis_search_button_text', 'sk_search_button_text' );
@burnified
burnified / Enqueue Typekit via Wordpress
Created March 28, 2014 19:25
Enqueue Typekit via Wordpress
/*** TypeKit Fonts ***/
function theme_typekit() {
wp_enqueue_script( 'theme_typekit', '//use.typekit.net/hoo8stk.js');
}
add_action( 'wp_enqueue_scripts', 'theme_typekit' );
function theme_typekit_inline() {
if ( wp_script_is( 'theme_typekit', 'done' ) ) { ?>
<script type="text/javascript">try{Typekit.load();}catch(e){}</script>
@Pross
Pross / functions.php
Created April 4, 2014 22:46
Remove thumbnail from single posts
<?php
function remove_post_thumbnail($metadata, $object_id, $meta_key, $single){
if( isset($meta_key) && '_thumbnail_id' === $meta_key && is_single() )
return false;
else
return $metadata;
}
add_filter('get_post_metadata', 'remove_post_thumbnail', true, 4);
@aaemnnosttv
aaemnnosttv / soft-disable-plugins.php
Created May 20, 2014 18:01
Soft Disable All WP Plugins
<?php
/**
* Plugin Name: Soft disable all WP plugins
* Author: Evan Mattson (@aaemnnosttv)
* Description: Allows all plugins to be softly disabled and re-enabled using a single constant.
* Version: 1.0
*
* Usage: Install this under mu-plugins/, and define('SOFT_DISABLE_PLUGINS', true) to soft disable all plugins.
* Delete/comment-out the constant definition or set to false to restore all plugins to their previous active states.
*
@thomasgriffin
thomasgriffin / gist:525dc80a20cb69c7e8bf
Created December 11, 2014 20:00
Turn off tracking in OptinMonster.
<?php
add_filter( 'optin_monster_data', 'tgm_om_turn_off_tracking' );
function tgm_om_turn_off_tracking( $data ) {
$data['tracked'] = true;
return $data;
}