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 | |
/** | |
* Keep your theme from updating | |
* http://markjaquith.wordpress.com/2009/12/14/excluding-your-plugin-or-theme-from-update-checks/ | |
*/ | |
function s25_no_update_theme( $r, $url ) { | |
if ( 0 !== strpos( $url, 'http://api.wordpress.org/themes/update-check' ) ) | |
return $r; // Not a theme update request. Bail immediately. | |
$themes = unserialize( $r['body']['themes'] ); | |
unset( $themes[ get_option( 'template' ) ] ); |
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 | |
// Hide Editor on Select Pages | |
function s25_hide_editor() { | |
// Get the Post ID. | |
$post_id = $_GET['post'] ? $_GET['post'] : $_POST['post_ID'] ; | |
if( !isset( $post_id ) ) return; | |
// Hide the editor on the page titled 'Homepage' | |
$homepgname = get_the_title($post_id); |
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 the page slug to filter the 'show-on' of a meta box | |
* @author Pat Ramsey | |
* @link https://gist.github.com/ramseyp/6227383 | |
* | |
* @param bool $display | |
* @param array $meta_box | |
* @return bool display metabox | |
*/ |
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 | |
/** | |
* Displays the content of a custom field, along with wrapping code or content. | |
* @param string $key name, or key, of the custom field. | |
* @param string $before what should be shown directly before the custom field value. | |
* @param string $after what is output directly after the custom field value. | |
* @param boolean $wpautop filters the value through wpautop(). | |
* @return string first value of the custom field, prepended by $before, followed by $after. | |
*/ |
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 | |
$testimeta = get_post_custom($testimq->post->ID); | |
if ( $testimeta['s25_testim_cred'][0] !='' ) { $cred = ', '. $testimeta['s25_testim_cred'][0]; } else { $cred = ''; } | |
echo '<div class="entry-content">'. wpautop( get_the_content($testimq->post->ID), true ) .'</div>'; | |
echo '<p class="attrib"><em>– '. get_the_title($testimq->post->ID) . $cred .'</em></p>'; | |
echo '</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 | |
function s25_full_bg() { | |
$pgmeta = get_post_custom(); | |
$pgbg = $pgmeta['s25_bg_image'][0]; | |
if ( !is_null( $pgbg ) ) : | |
echo '<style type="text/css">body{background-image:none !important;background-color:#000 !important;}</style>'; | |
echo '<div class="lpage_bg" style="position:fixed;left:0;top:0;width:100%;height:100%;z-index:-1;background: #ccc url('. $pgbg .') no-repeat fixed center center;-webkit-background-size: cover;-moz-background-size: cover;-o-background-size: cover;background-size: cover;filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'. $pgbg .'", sizingMethod=\'scale\');-ms-filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'. $pgbg .'", sizingMethod=\'scale\')";> </div>'; | |
echo '<!--[if IE 8 ]> |
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 namespace_add_custom_types( $query ) { | |
if( is_tag() && empty( $query->query_vars['suppress_filters'] ) ) { | |
$post_type = get_query_var('post_type'); | |
if($post_type) | |
$post_type = $post_type; | |
else | |
$post_type = array( 'post', 'case_study','solution_sheet','white_paper' ); | |
$query->set( 'post_type', $post_type ); | |
return $query; |
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 | |
/** | |
* [short_title description] | |
* @param $postid the ID of the $post object | |
* @param $length How long the title should be | |
* @return Post / Page title shortened to the number of characters in $length | |
* Usage: short_title( $postid, 45 ); | |
*/ | |
function short_title( $postid,$length) { | |
global $post; |
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
/** | |
* | |
* Add Google Webfonts | |
*/ | |
add_action('wp_head','s25_webfont_load'); | |
function s25_webfont_load() { | |
echo '<link href="//fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic,700italic|Archivo+Black" rel="stylesheet" type="text/css" />'; | |
} |