This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php $terms_as_text = get_the_term_list( $post->ID, 'filter', '', ', ', '' ) ; | |
echo strip_tags($terms_as_text); ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// function: post_type BEGIN | |
function post_type() | |
{ | |
// Create The Labels (Output) For The Post Type | |
$labels = | |
array( | |
// The plural form of the name of your post type. | |
'name' => __( 'Portfolio'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ul class="filterable-grid clearfix"> | |
<?php $wpbp = new WP_Query(array( 'post_type' => 'portfolio', 'posts_per_page' =>'-1' ) ); ?> | |
<?php if ($wpbp->have_posts()) : while ($wpbp->have_posts()) : $wpbp->the_post(); ?> | |
<?php $terms = get_the_terms( get_the_ID(), 'filter' ); ?> | |
<li data-id="id-<?php echo $count; ?>" data-type="<?php foreach ($terms as $term) { echo strtolower(preg_replace('/\s+/', '-', $term->name)). ' '; } ?>"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Register our Scripts | |
function register_js() { | |
if (!is_admin()) { | |
wp_deregister_script('jquery'); | |
wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js'); | |
wp_register_script('quicksand', get_template_directory_uri() . '/js/jquery.quicksand.js', 'jquery'); | |
wp_register_script('easing', get_template_directory_uri() . '/js/jquery.easing.1.3.js', 'jquery'); | |
wp_register_script('custom', get_template_directory_uri() . '/js/jquery.custom.js', 'jquery', '1.0', TRUE); | |
wp_register_script('prettyPhoto', get_template_directory_uri() . '/js/jquery.prettyPhoto.js', 'jquery'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// get portfolio | |
$args = array( 'post_type' => 'portfolio', 'posts_per_page' => 100, 'orderby' => 'title', 'order' => 'asc' ); | |
$loop = new WP_Query( $args ); | |
$port = array(); | |
while ( $loop->have_posts() ) : $loop->the_post(); | |
$idx = get_the_ID(); | |
$year_completed = get_post_meta($idx, 'year_completed', true); | |
$website_addr = get_post_meta($idx, 'website_address', true); | |
$thumb = get_the_post_thumbnail($idx, 'thumbnail'); //250x200 - featured image |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
?php | |
// Inspired by a snippet by Justin Tadlock (http://justintadlock.com/) posted here: http://elliotjaystocks.com/blog/tutorial-multiple-singlephp-templates-in-wordpress/#comment-2383 | |
add_filter( 'category_template', 'my_category_template' ); | |
// I believe *_template hooks exist for just about every type of template so it's easy to apply to other templates as well | |
function my_category_template( $template ) { | |
if( is_category( 1 ) ) // We can search for categories by ID | |
$template = locate_template( array( 'template_id_A.php', 'category.php' ) ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<figure class="swapimage"> | |
<img src="<?php $image = get_post_meta($post->ID, 'normal', true); ?><?php echo $image; ?>" alt="" /> | |
<img src="<?php $hover = get_post_meta($post->ID, 'hover', true); ?><?php echo $hover; ?>" class="swap-target" alt="" /> | |
</figure> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.swapimage { | |
display: block; | |
position: relative; | |
margin: 0px; | |
padding: 0px; | |
transition: all 2s; | |
margin-bottom: 12px; | |
border: 1px solid #fff; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php $categories = get_the_category(); | |
$temp = array(); | |
foreach($categories as $category) { | |
if ($category->category_parent == 0) continue; | |
$temp[] = str_replace('-', '', $category->name); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function setEqualHeight(columns) | |
{ | |
var tallestcolumn = 0; | |
columns.each( | |
function() | |
{ | |
currentHeight = $(this).height(); | |
if(currentHeight > tallestcolumn) | |
{ | |
tallestcolumn = currentHeight; |
OlderNewer