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
// Limit Excerpt Length !!! | |
function new_excerpt_length($length) { | |
return 23; | |
} | |
add_filter('excerpt_length', 'new_excerpt_length'); | |
// And Lose the Ellipse | |
function excerpt_ellipse($text) { |
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
// Twitter Pull | |
function getTwitterStatus($name, $count) | |
{ | |
$transient = "$name"."_$count"; | |
//Get Tweets From the Cache | |
$getTweets = get_transient($transient); | |
if ($getTweets) | |
{ |
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
// Get Custom Field Template Values | |
function getCustomField($theField) { | |
global $post; | |
$block = get_post_meta($post->ID, $theField); | |
if($block){ | |
foreach(($block) as $blocks) { | |
echo $blocks; | |
} | |
} | |
} |
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
// Remove Login Errors Display | |
add_filter('login_errors',create_function('$a', "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
// Remove WP Version # from Head | |
remove_action('wp_head', 'wp_generator'); |
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
// Calm down NextGEN Gallery | |
function nextgen_styles() { | |
wp_deregister_style('NextGEN'); | |
} | |
add_action('wp_print_styles', 'nextgen_styles', 100); | |
define('NGG_SKIP_LOAD_SCRIPTS', true); | |
function global_hide_ngg_version() { | |
return false; | |
} |
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
// Add Image to Admin Column | |
add_image_size( 'admin-list-thumb', 100, 63, false ); | |
// Add the posts and pages columns filter. They can both use the same function. | |
add_filter('manage_posts_columns', 'tcb_add_post_thumbnail_column', 5); | |
add_filter('manage_pages_columns', 'tcb_add_post_thumbnail_column', 5); | |
// Add the column | |
function tcb_add_post_thumbnail_column($cols){ |
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
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<script> | |
var metas = document.getElementsByTagName('meta'); | |
var i; | |
if (navigator.userAgent.match(/iPhone/i)) { | |
for (i=0; i<metas.length; i++) { | |
if (metas[i].name == "viewport") { | |
metas[i].content = "width=device-width, minimum-scale=1.0, maximum-scale=1.0"; | |
} |
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
// Regulate that tag cloud | |
function myfunc_filter_tag_cloud($args) { | |
$args['smallest'] = 14; | |
$args['largest'] = 14; | |
$args['unit'] = 'px'; | |
$args['separator']= ', '; | |
return $args; | |
} | |
add_filter ( 'widget_tag_cloud_args', 'myfunc_filter_tag_cloud'); |
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
// Kill Default Inline Style on Captions | |
add_shortcode('wp_caption', 'fixed_img_caption_shortcode'); | |
add_shortcode('caption', 'fixed_img_caption_shortcode'); | |
function fixed_img_caption_shortcode($attr, $content = null) { | |
if ( ! isset( $attr['caption'] ) ) { | |
if ( preg_match( '#((?:<a [^>]+>\s*)?<img [^>]+>(?:\s*</a>)?)(.*)#is', $content, $matches ) ) { | |
$content = $matches[1]; | |
$attr['caption'] = trim( $matches[2] ); |