Skip to content

Instantly share code, notes, and snippets.

Avatar
🚀
👨‍🏭

Jeremy Herve jeherve

🚀
👨‍🏭
View GitHub Profile
@jeherve
jeherve / jp_restrict_rp.php
Last active Feb 10, 2018 — forked from richardmtl/jp_restrict_rp.php
Restrict Jetpack's Related Posts to a specific time-frame
View jp_restrict_rp.php
function jetpackme_related_posts_date_restricted( $date_range, $post_id ) {
// We can change this based on $post_id too but let's just filter everything
$date_range = array(
'from' => strtotime( '1 January 2013' ),
'to' => time(),
);
return $date_range;
}
add_filter( 'jetpack_relatedposts_filter_date_range', 'jetpackme_related_posts_date_restricted', 10, 2 );
View inc-author-box.php
<?php
/**
* When hooked to either the_content or the_excerpt filters,
* this should append the contents of the `author-box.php`
* file in your theme before the Jetpack ShareDaddy contents
* is added, so long as the priority is 18 or less!
* (as ShareDaddy's sharing options go in at priority 19)
*
* @param string $content The post content as passed to the function
@jeherve
jeherve / widget-visibility-tweaks.php
Last active Dec 23, 2015 — forked from georgestephanis/gplus-authorship-tweaks.php
[Jetpack] Do not automatically activate the Widget Visibility module
View widget-visibility-tweaks.php
<?php
// To disable the auto-activation of Jetpack's Widget Visibility module:
add_filter( 'jetpack_get_default_modules', 'disable_jetpack_widget_visibility_autoactivate' );
function disable_jetpack_widget_visibility_autoactivate( $modules ) {
return array_diff( $modules, array( 'widget-visibility' ) );
}
// Or, to disable the functionality in your own plugin if the user activates it in Jetpack:
@jeherve
jeherve / inc-signature.php
Last active Dec 17, 2015 — forked from georgestephanis/inc-author-box.php
Include your signature before Jetpack's sharing buttons
View inc-signature.php
<?php
/**
* When hooked to either the_content or the_excerpt filters,
* this should append the signature before the Jetpack sharing buttons
* are added, so long as the priority is 18 or less!
* (as Jetpack's sharing options go in at priority 19)
*
* @param string $content The post content as passed to the function
* @returns string The content with the author box appended to it.
You can’t perform that action at this time.