Skip to content

Instantly share code, notes, and snippets.

@tomharrigan
tomharrigan / gist:482be6485bb113b44a4b
Last active August 29, 2015 14:11
Enable Infinite Post Transporter in Genesis
add_action( 'init', 'metro_pro_infinite_transporter_init' );
function metro_pro_infinite_transporter_init() {
add_theme_support( 'infinite-transporter', array(
'container' => 'main-content',
'footer' => false,
'render' => 'genesis_render'
) );
}
function genesis_render() {
if ( have_posts() ) :
@tomharrigan
tomharrigan / gist:a0e889d1c0e90e63ea11
Created May 15, 2014 19:01
Delete excerpts for all posts except those is specified category
UPDATE wp_5_posts SET post_excerpt='' WHERE 1=1 AND ( wp_5_posts.ID NOT IN ( SELECT object_id FROM wp_5_term_relationships WHERE term_taxonomy_id IN (95225) ) ) AND wp_5_posts.post_type = 'post'
$slides = get_transient( 'home_slides_test' );
if( false === $slides ) {
$slides = new WP_Query(array(
'meta_query' => array(
array(
'key' => '_tdrfeatured',
'value' => 'on',
'compare' => '='
function acf_fix_old_full_width( $field ) {
$tdrfullwidth = get_post_custom_values('_tdrfullwidth');
if( isset( $tdrfullwidth ) ) {
if( $tdrfullwidth[0] === 'on') {
update_post_meta( get_the_id(), 'full_width_header', 'parallax');
}
delete_post_meta( get_the_id(), '_tdrfullwidth');
}
function my_acf_load_field( $field ) {
$tdrfullwidth = get_post_custom_values('_tdrfullwidth');
if( isset( $tdrfullwidth ) ) {
if( $tdrfullwidth === 'on') {
$field['default_value'] = 'parallax';
}
delete_post_meta( get_the_id(), '_tdrfullwidth');
}
return $field;
}
function woo_featured_slider_loader () {
wooslider( array('slider_type' => 'slides'), array('imageslide' => 'true', 'overlay' => 'natural', 'layout' => 'text-left') );
} // End woo_featured_slider_loader()
<?php
// File Security Check
if ( ! function_exists( 'wp' ) && ! empty( $_SERVER['SCRIPT_FILENAME'] ) && basename( __FILE__ ) == basename( $_SERVER['SCRIPT_FILENAME'] ) ) {
die ( 'You do not have sufficient permissions to access this page!' );
}
?><?php
/**
* Index Template
*
* Here we setup all logic and XHTML that is required for the index template, used as both the homepage
function woo_options_add($options) {
global $woo_options;
$homepage_slide_options = array( __( 'Select a number:', 'woothemes' ) );
$total_possible_slides = 10;
for ( $i = 1; $i <= $total_possible_slides; $i++ ) { $homepage_slide_options[] = $i; }
$shortname = 'woo';
@import url(http://fonts.googleapis.com/css?family=Allerta+Stencil);
h1.page-title,h1.product_title {
color: #fff;
font-family: 'Allerta Stencil';
}
ul.products.list li.product .img-wrap {
background: none;
width: auto;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
padding: 0;
}
ul.products.list li.product .img-wrap:before {
content: none;