Skip to content

Instantly share code, notes, and snippets.

@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.
*
@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>
<?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;
}
@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>
@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
*/
@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',
@vovafeldman
vovafeldman / functions.php
Last active January 25, 2022 04:23
Freemius - WP Markdown Editor, Exporting
<?php
/**
* When exporting using WP default export tool, use the
* markdown version when exist.
*
* @author Vova Feldman
*
* @param string $content
*
* @return string
@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' );
@feastdesignco
feastdesignco / modern-homepage-blocks
Last active October 7, 2022 22:37
modern-homepage-blocks
<!-- wp:paragraph -->
<p>First, update your post title to match your site tagline. Then, edit this paragraph to match your homepage's meta description tag, which should tell potential readers what your site specializes in. Keep it to no more than 2-3 sentences.</p>
<!-- /wp:paragraph -->
<!-- wp:heading -->
<h2>Trending Recipes</h2>
<!-- /wp:heading -->
<!-- wp:paragraph -->
<p>Edit this paragraph to tell your readers why these recipes are so popular right now</p>