This file contains hidden or 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
/*=Search Box | |
-----------------------------*/ | |
#search-box { | |
position:absolute; | |
top:30px; | |
right:80px; | |
} | |
#search-box input[type=text] { | |
font-family:sans-serif; | |
background:#fff; |
This file contains hidden or 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 // requires php5.3 | |
function add_post_type( $name, $args = array() ) { | |
add_action( 'init', function() use( $name, $args ) { | |
$upper = ucwords( str_replace( '_', ' ', $name ) ); | |
$lower = strtolower( str_replace( '_', ' ', $name ) ); | |
$name = strtolower( str_replace( ' ', '_', $name ) ); | |
$labels = array( | |
'name' => _x( $upper . 's', $name ), | |
'singular_name' => _x( $upper, $name ), |
This file contains hidden or 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 | |
// recursively looks for featured images | |
function get_featured_recursive( $post ) { | |
if ( has_post_thumbnail( $post->ID ) ) { | |
return $post->ID; | |
} else if ( $post->post_parent != 0 ) { | |
return get_featured_recursive( get_post( $post->post_parent ) ); | |
} else { | |
return null; | |
} |
This file contains hidden or 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
// equal height containers | |
var contentHeight = $('.content').height(); | |
var sidebarHeight = $('.sidebar').height(); | |
if (contentHeight < sidebarHeight) { | |
$('.content').css('height', sidebarHeight + 'px'); | |
} else { | |
$('.sidebar').css('height', contentHeight + 'px'); | |
} |
This file contains hidden or 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
/*=LESS Mixins | |
---------------------------------------*/ | |
/*=Helpers | |
-----------------------------*/ | |
.clearfix { | |
*zoom: 1; | |
&:before, &:after { | |
content: ""; display: table; | |
} |
This file contains hidden or 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 | |
$args = array( | |
'orderby' => 'ID' | |
); | |
$terms = get_terms( 'testimonial_category', $args ); | |
?> | |
<!-- bootstrap tabs --> | |
<ul class="nav-tabs"> | |
<?php |
This file contains hidden or 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
/* http://css-tricks.com/equal-height-blocks-in-rows/ */ | |
var currentTallest = 0, | |
currentRowStart = 0, | |
rowDivs = new Array(); | |
function setConformingHeight(el, newHeight) { | |
// set the height to something new, but remember the original height in case things change | |
el.data("originalHeight", (el.data("originalHeight") == undefined) ? (el.height()) : (el.data("originalHeight"))); | |
el.height(newHeight); |
This file contains hidden or 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 | |
// Excerpt character count | |
function excerpt_count_js() { ?> | |
<script> | |
jQuery(document).ready(function ($) { | |
var counterVal = $('#excerpt-counter input').val($('#excerpt').val().length); | |
$('#postexcerpt .handlediv').after('<div id="excerpt-counter"><small>Excerpt length: </small> <input type="text" value="0" maxlength="3" size="1" readonly> <small>character(s)</small></div>'); | |
counterVal | |
This file contains hidden or 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
{* if per page is set add canonical link *} | |
{if isset($_REQUEST.items_per_page)} | |
{assign var="page_current" value="/page-`$pagination.current_page`"} | |
{assign var="can_url" value=$config.current_url|fn_query_remove:"items_per_page"|fn_url} | |
{assign var="page_url" value=$can_url|replace:"$page_current":""} | |
<link href="{$config.current_location}{$page_url}" rel="canonical"> | |
{/if} | |
{* if paginated add rel prev/next links *} | |
{if $pagination.current_page >= 1} |
This file contains hidden or 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 | |
// Custom Excerpt | |
function custom_trim_words( $text, $num_words = 55, $more = null ) { | |
if ( null === $more ) | |
$more = __( '…' ); | |
$original_text = $text; | |
$text = strip_shortcodes( $text ); | |
// Add tags that you don't want stripped |