Skip to content

Instantly share code, notes, and snippets.

@BrianBourn
BrianBourn / functions.php
Last active August 29, 2015 13:58
WordPress 3.9 filter to remove the blog and archive page templates from Genesis, and function to remove the Genesis theme settings blog metabox
<?php //Do not include opening php tag
add_filter( 'theme_page_templates', 'bourncreative_remove_page_templates' );
/**
* Remove Genesis blog and archive templates from page templates dropdown.
*
* @author Brian Bourn
* @link http://www.bourncreative.com/remove-genesis-blog-archive-page-templates/
*
* @param array $templates List of templates.
@pmgllc
pmgllc / content_limit_tags.php
Created July 3, 2014 18:07
Allow HTML tags in content limit
<?php
add_filter( 'get_the_content_limit_allowedtags', 'get_the_content_limit_custom_allowedtags' );
/**
* @author Brad Dalton
* @example http://wp.me/p1lTu0-a5w
*/
function get_the_content_limit_custom_allowedtags() {
// Add custom tags to this string
return '<script>,<style>,<br>,<em>,<i>,<ul>,<ol>,<li>,<a>';
@hlashbrooke
hlashbrooke / function.php
Created July 14, 2014 15:44
Sensei - Disable "Pass required to complete lesson" on all lessons. Add this to your theme's functions.php file and then load any frontend page on the site. After that you must remove the code from your site.
<?php
add_action( 'init', 'sensei_disable_pass_required_all_lessons' );
function sensei_disable_pass_required_all_lessons() {
if( is_admin() ) {
return;
}
global $woothemes_sensei;
<?php
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
/**
* Sensei Frontend Class
*
* All functionality pertaining to the frontend of Sensei.
*
* @package WordPress
* @subpackage Sensei
<?php
/**
* Intro Content
*
*/
function be_intro_content() {
if( is_page() )
$intro = get_post_meta( get_the_ID(), 'be_intro_content', true );
if( is_home() )
@chrillo
chrillo / mobilehtaccess
Created November 29, 2011 08:11
htaccess redirect all mobile traffic to specific landing page
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_URI} !^/landingpage/.$
RewriteCond %{HTTP_USER_AGENT} android|avantgo|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge\ |maemo|midp|mmp|opera\ m(ob|in)i|palm(\ os)?|phone|p(ixi|re)\/|plucker|pocket|psp|symbian|treo|up\.(browser|link)|vodafone|wap|windows\ (ce|phone)|xda|xiino [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^(1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a\ wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r\ |s\ )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1\ u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp(\ i|ip)|hs\-c|ht(c(\-|\ |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac(\ |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|
@WebEndevSnippets
WebEndevSnippets / genesis_site_layout.php
Created October 20, 2012 23:11 — forked from wpsmith/genesis_site_layout.php
Genesis: Force Specific Layout on a page
/**** Truly Force Layout without allowing the User to Override the preferred/recommended layout ****/
// Force Full Width Layout
add_filter( 'genesis_site_layout', '__genesis_return_full_width_content' );
// Force Content-Sidebar Layout
add_filter( 'genesis_site_layout', '__genesis_return_content_sidebar' );
// Force Sidebar-Content Layout
add_filter( 'genesis_site_layout', '__genesis_return_sidebar_content' );
@surefirewebserv
surefirewebserv / gist:5504412
Created May 2, 2013 18:49
Much Simpler Grid Loop. Takes the post class and adds the column class to it. Also takes the first x posts and removes that class, which poses as a "featured" type of post. No crazy manipulation, just messing with classes and adding the right size images... Blog Post To come...
<?php
add_action('genesis_before_post_title', 'sfws_homepage_teaser_image');
/**
* Adds Images to Posts in Grid
*
* Takes the amount of posts and applies the right size image, whether it's a featured post or a grid block post.
*
* @category Grid Loop
* @author Jonathan Perez, SureFireWebServices <jperez@surefirewebservices.com>
function add_genesis_before_post () {
echo '<div class="before-post">genesis_before_post</div>';
};
add_action('genesis_before_post', 'add_genesis_before_post');
function add_genesis_before_post_title() {
echo '<div class="before-post-title">genesis_before_post_title</div>';
@JiveDig
JiveDig / gist:5754159
Last active December 18, 2015 08:29
Fix checkbox and radio button styling in Genesis
input[type="checkbox"],
input[type="radio"] {
width: 20px;
margin: 0 0 3px 3px;
vertical-align: middle;
}