Skip to content

Instantly share code, notes, and snippets.

@smeyer
smeyer / gist:25fe1f3b0b4ab7303b64
Created July 15, 2014 19:23
Infographic ScrollMagic
jQuery(function ($) {
var windowHeight = $(window).height();
function getChildHeight(parent) {
var insideparentheight = $( parent + ' .infoslide_inside' ).height();
$( parent + ' .infoslide_half' ).each(function() {
var infoslidehalfheight = $(this).height();
@smeyer
smeyer / archive-portfolio.php
Created September 12, 2011 22:40
Archive page for portfolio post type
<?php
/*
Template Name: Portfolio
*/
?>
<?php get_header();
if (is_tax('portfolio-category')) { $_SESSION['original'] = 'portfolio-category'; }
else if (is_tax('portfolio-client')) { $_SESSION['original'] = 'portfolio-client'; }
@smeyer
smeyer / sidebar.php
Created December 20, 2011 22:29
Sidebar file for Chameleon
<div id="sidebar">
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Sidebar') ) : ?>
<?php endif; ?>
</div> <!-- end #sidebar -->
@smeyer
smeyer / press-post-type.php
Created January 4, 2012 17:14
press post type with custom meta check box
<?php
/* Create Post Type */
function create_press_post_type() {
register_post_type( 'off_press',
array(
'labels' => array(
'name' => __( 'Off the Press' ),
'singular_name' => __( 'Off the Press' ),
'add_new' => __( 'Add Press Item' ),
'add_new_item' => __( 'Add Press Item' ),
@smeyer
smeyer / press-post-type.php
Created January 4, 2012 18:13
press post type with custom meta check box 3
<?php
/* Create Post Type */
function create_press_post_type() {
register_post_type( 'off_press',
array(
'labels' => array(
'name' => __( 'Off the Press' ),
'singular_name' => __( 'Off the Press' ),
'add_new' => __( 'Add Press Item' ),
'add_new_item' => __( 'Add Press Item' ),
@smeyer
smeyer / press-post-type.php
Created January 4, 2012 17:58
press post type with custom meta check box 2
<?php
/* Create Post Type */
function create_press_post_type() {
register_post_type( 'off_press',
array(
'labels' => array(
'name' => __( 'Off the Press' ),
'singular_name' => __( 'Off the Press' ),
'add_new' => __( 'Add Press Item' ),
'add_new_item' => __( 'Add Press Item' ),
@smeyer
smeyer / display_featured_post function
Created January 4, 2012 22:12
display checked posts
function display_featured_post()
{
$args = array(
'orderby' => 'date',
'order' => DESC,
'posts_per_page' => 1,
'post_type' => 'off_press',
'meta_query' => array( 'meta_key' => '_bb_feat', 'meta_value' => 'on' )
);
$the_query = new WP_Query($args);
@smeyer
smeyer / archive-jobs.php
Created May 31, 2012 16:25
archive-jobs.php
<?php get_header(); ?>
<div id="content">
<div class="loop-meta archive-info taxonomy-info">
<h1 class="loop-title archive-title taxonomy-title"><?php single_term_title(); ?></h1>
<div class="loop-description archive-description taxonomy-description">
<?php echo term_description( '', get_query_var( 'taxonomy' ) ); ?>
</div><!-- .loop-description -->
</div><!-- .loop-meta -->
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
@smeyer
smeyer / switcher.js
Created June 29, 2012 17:36
switcher
<script type="text/javascript">
$(document).ready(function() {
switchers = $('#switchers > li');
states = $('#state_info > div');
switchers.each(function(idx) {
$(this).data('state', states.eq(idx));
}).click(
function() {
switchers.removeClass('active');
states.removeClass('active');
<?php
/*
* Template Name: Map
* Description: Map Page Design
*/
get_header(); ?>
<script type="text/javascript">