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 | |
class PurgeTransients { | |
var $expire = '7 days'; | |
function __construct(){ | |
add_action( 'admin_init', array( &$this, 'init' ) ); | |
} | |
function init(){ | |
$this->purge( $this->expire ); |
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_filter( 'continue_reading_link_text', 'add_my_continue' ); | |
function add_my_continue() { | |
return 'Continue Reading <i class="icon-beer"></i>'; | |
} |
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_filter( 'the_content', 'add_my_signature' ); | |
function add_my_signature( $content ){ | |
if( ! is_single() ) // if were not on a post/page just return the content. | |
return $content; | |
$sig = '<br />Thanks for reading!'; // Add a sig to the post/page content and return. | |
return $content . $sig; | |
} |
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_action( 'wp_footer', 'add_my_footer_shortcode' ); | |
function add_my_footer_shortcode(){ | |
echo do_shortcode( '[some_shortcode]' ); | |
} |
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_action( 'navbar_brand', 'remove_fixed_navbar_logo' ); | |
function remove_fixed_navbar_logo(){ | |
return ''; | |
} |
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_action( 'pagelines_logo_url', 'change_logo_url' ); | |
function change_logo_url( $url ){ | |
// $url contains original image url. | |
// lets change the image for one page. | |
global $post; | |
if( 96 == $post->ID ) | |
$url = 'http://placekitten.com/g/200/300'; | |
return $url; | |
} |
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 | |
/** | |
* Include all the theme support | |
*/ | |
add_theme_support( 'automatic-feed-links' ); | |
add_theme_support( 'post-formats', array( 'aside', 'gallery' ) ); | |
add_theme_support( 'post-thumbnails' ); | |
add_custom_background(); | |
add_editor_style( 'css/editor-style.css' ); | |
add_image_size( 'random-thumb', 125, 125 ); |
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 this to wp-content/mu-plugins/crm.php | |
if( class_exists( 'CRM_Utils_System_WordPress' ) ) { | |
class Fix_CRM_Cron extends CRM_Utils_System_WordPress { | |
function __construct() { | |
if( ! defined( 'CRMCRON' ) ) | |
return; | |
add_filter('template', array( &$this, 'change_theme') ); |
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_filter( 'pagelines_features_target', create_function('', "return 'target=\"_blank\"';") ); |
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 | |
class Cache { | |
function __construct( $format = '' ) { | |
$this->format = $format; | |
$this->cache_life = '1200'; | |
$this->cache_file = 'cache/' . md5( $_SERVER['REQUEST_URI'] );; | |
// check exists.... |