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 fb_home_image( $tags ) { | |
if ( is_home() ) { | |
$latest_post = get_posts("post_type=post&numberposts=1"); | |
$latest_post = $latest_cpt[0]->ID; | |
if ( class_exists( 'Jetpack_PostImages' ) ) { | |
$post_images = Jetpack_PostImages::get_images( $latest_post, array( 'width' => 200, 'height' => 200 ) ); | |
if ( $post_images && !is_wp_error( $post_images ) ) { | |
$image = array(); |
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_action('init', 'kraft_woo_publicize'); | |
function kraft_woo_publicize() { | |
add_post_type_support( 'product', 'publicize' ); | |
} |
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 no_livecam_photon() { | |
if ( is_page( 2 ) ) { | |
add_filter( 'jetpack_photon_skip_image', '__return_true'); | |
} | |
} | |
add_action('wp', 'no_livecam_photon'); |
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 | |
/* | |
* Plugin Name: Very Simple Pinterest Plugin | |
*/ | |
function bk_vspp() { | |
echo '<script type="text/javascript" async data-pin-height="28" data-pin-hover="true" src="//assets.pinterest.com/js/pinit.js"></script>'; | |
} | |
add_action( 'wp_footer', 'bk_vspp'); |
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
function sp_share_buttons_below_post( $post_meta ) { | |
if ( is_single() ) { | |
return sharing_display().$post_meta; | |
} | |
} | |
add_filter( 'genesis_post_meta', 'sp_share_buttons_below_post', 10); |
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
function tweakjp_custom_twitter_site( $og_tags ) { | |
$og_tags['twitter:site'] = '@kraft'; | |
return $og_tags; | |
} | |
add_filter( 'jetpack_open_graph_tags', 'tweakjp_custom_twitter_site', 11 ); |
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 support for Jetpack infinite scroll | |
**/ | |
function kraft_infinite_scroll_init() { | |
add_theme_support( 'infinite-scroll', array( | |
'container' => 'content', | |
'footer_widgets' => 'footer-1', | |
'render' => 'genesis_do_loop', | |
'footer' => 'footer' | |
) ); |
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 jetpackme_no_related_posts( $options ) { | |
if ( is_single( array( 17, 19, 1, 11 ) ) ) { // specific post IDs by number, or slug/post title in quotes | |
$options['enabled'] = false; | |
} | |
return $options; | |
} | |
add_filter( 'jetpack_relatedposts_filter_options', 'jetpackme_no_related_posts' ); |
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
function jetpackme_related_posts_past_year_only( $date_range ) { | |
$date_range = array( | |
'from' => strtotime( '-2 months' ), | |
'to' => time(), | |
); | |
return $date_range; | |
} | |
add_filter( 'jetpack_relatedposts_filter_date_range', 'jetpackme_related_posts_past_year_only' ); |
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
$jetpack_active_modules = get_option('jetpack_active_modules'); | |
if ( class_exists( 'Jetpack', false ) && $jetpack_active_modules && in_array( 'minileven', $jetpack_active_modules ) && jetpack_is_mobile() ) { | |
function jetpackme_no_related_posts_mobile( $options ) { | |
if ( is_single( array( 17, 19, 1, 11 ) ) ) { | |
$options['enabled'] = false; | |
} | |
return $options; | |
} | |
add_filter( 'jetpack_relatedposts_filter_options', 'jetpackme_no_related_posts_mobile' ); | |
} |
OlderNewer