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 | |
/* | |
* Remove empty <p> tags from the_content() input | |
* | |
*/ | |
add_filter('the_content', 'remove_empty_p', 20, 1); | |
function remove_empty_p($content){ | |
$content = force_balance_tags($content); | |
return preg_replace('#<p>\s*+(<br\s*/*>)?\s*</p>#i', '', $content); | |
} |
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 | |
/** | |
* Set up faux the_content() simulation | |
* | |
* You can use this to simulate the_content() through a shortcode. Simply | |
* add the shortcode [faux] on any page in wp-admin and publish. Then, | |
* Then, make all your changes in your favorite text editor in the includes/faux-content.php | |
* file. Once finished, paste the contents of includes/faux-content.php into the page in wp-admin. | |
*/ | |
function faux_the_content_() { |
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 | |
/* | |
* Add div section within the content as a short code. | |
* | |
* This allows users to edit content in visual mode without stripping | |
* out necessary but hidden <div> tags. | |
* | |
* Example usages: | |
* [section]My Content[/section] = <div>My Content</div> | |
* [section width='6']My Content[/section] = <div class="col6">My Content</div> |
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 | |
//hostname based google code, only run if on live site - Tom Horak | |
//placed right before closing body tag according to google best practice: http://support.google.com/googleanalytics/bin/answer.py?hl=en&answer=55488 | |
//moved to right before closing head tag per SEOverflow 05/25/12 | |
$hostname = $_SERVER['HTTP_HOST']; //dev.zenman.com | localhost | Live server | etc.. | |
switch ($hostname) { | |
case 'localhost': //do nothing | |
//echo '<!-- no google analytics code -->'; | |
break; |
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 | |
/* | |
* Use Parent Category | |
* Description: Causes subcategories to use their parent's template | |
*/ | |
function load_cat_parent_template(){ | |
global $wp_query; | |
if (!$wp_query->is_category) { | |
return true; // saves a bit of nesting |
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
var scrollToAnchor = function() { | |
//cache some variables | |
var scrollElement = 'html, body', | |
$window = $(window); | |
//grab all the anchor links | |
$("a[href^='#']").click(function(e) { | |
//stop immediate scroll | |
e.preventDefault(); |
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 $the_query = new WP_Query('cat=3&posts_per_page=2'); ?> | |
<?php if ($the_query->have_posts()) : ?> | |
<?php while ($the_query->have_posts()) : $the_query->the_post(); ?> | |
output... | |
<?php endwhile; wp_reset_postdata();?> | |
<?php endif; ?> |
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
.tabs{ | |
margin: {top:40px;} | |
&:last-child{ | |
margin: {bottom:80px;} | |
} | |
h2{ | |
color: $color-1; | |
font: { | |
size: emCalc(36px); | |
} |