Skip to content

Instantly share code, notes, and snippets.

View jeherve's full-sized avatar
🚀
👨‍🏭

Jeremy Herve jeherve

🚀
👨‍🏭
View GitHub Profile
@jeherve
jeherve / functions.php
Last active October 10, 2016 13:48
[Jetpack] Customize the contents of the "Older Posts" text appearing when activating Infinite Scroll.
<?php
function jeherve_custom_infinite_more() {
if ( is_home() || is_archive() ) {
?>
<script type="text/javascript">
//<![CDATA[
infiniteScroll.settings.text = "Custom Text";
//]]>
</script>
@jeherve
jeherve / plugin.php
Last active September 11, 2016 03:00
[Jetpack] Remove the Youtube shortcode
<?php
/*
* Plugin Name: Remove Jetpack's Youtube shortcode
* Plugin URI: http://wordpress.org/extend/plugins/jetpack/
* Description: Removes Jetpack's Youtueb shortcode
* Author: Jeremy Herve
* Version: 1.0
* Author URI: http://jeremyherve.com
* License: GPL2+
*/
@jeherve
jeherve / plugin.php
Created December 9, 2013 13:26
[Jetpack] Force deactivate all modules but stats
<?php
// Force deactivate all Jetpack modules, except for stats
function jeherve_force_deactivate_everything_but_stats() {
if ( class_exists( 'Jetpack_Options' ) )
Jetpack_Options::update_option( 'active_modules', array_unique( array( 'stats' ) ) );
}
add_action( 'init', 'jeherve_force_deactivate_everything_but_stats' );
@jeherve
jeherve / output.bash
Created June 7, 2016 16:43
Photon image including a link to the original image https://i0.wp.com/jeremy.hu/wp-content/uploads/watson-5818.jpg
$ curl -I https://i0.wp.com/jeremy.hu/wp-content/uploads/watson-5818.jpg
HTTP/1.1 200 OK
Server: nginx
Date: Tue, 07 Jun 2016 16:42:27 GMT
Content-Type: image/jpeg
Content-Length: 94394
Connection: keep-alive
Last-Modified: Tue, 07 Jun 2016 16:37:17 GMT
Expires: Fri, 08 Jun 2018 04:37:17 GMT
Cache-Control: public, max-age=63115200
@jeherve
jeherve / plugin.php
Last active June 6, 2016 15:09
Create an ordered list of popular posts, using Jetpack's Site Stats. See wordpress.org/support/topic/2883315
<?php
/**
* Create an ordered list of popular posts, using Jetpack's Site Stats.
*
* @see wordpress.org/support/topic/2883315
*/
function jeherve_new_top_posts() {
if ( ! function_exists( 'stats_get_csv' ) ) {
@jeherve
jeherve / plugin.php
Last active May 31, 2016 18:21
Random classes for each post.
<?php
/**
* Plugin Name: Random classes for each post
* Plugin URI: http://jeremy.hu
* Description: Random classes for each post
* Version: 1.0
* Author: Jeremy Herve
* Author URI: http://jeremy.hu
* Text Domain: jeherve
* Domain Path: /languages/
@jeherve
jeherve / plugin.php
Last active May 14, 2016 00:59
[Jetpack] Remove all CSS.
<?php
// First, make sure Jetpack doesn't concatenate all its CSS
add_filter( 'jetpack_implode_frontend_css', '__return_false' );
// Then, remove each CSS file, one at a time
// You probably won't need them all, unless you use all the modules, and all the themes! :)
// Some of these are also only loaded on specific admin pages, so it wouldn't affect your readers
function jeherve_remove_all_jp_css() {
wp_deregister_style( 'AtD_style' ); // After the Deadline
@jeherve
jeherve / plugin.php
Created May 11, 2016 16:22
Jetpack's Top Posts Widget: add post date and post author below each post.
<?php
/**
* Plugin Name: Top Posts Widget: add post date and post author below each post.
* Plugin URI: http://jeremy.hu
* Description: Top Posts Widget: add post date and post author below each post.
* Version: 1.0
* Author: Jeremy Herve
* Author URI: http://jeremy.hu
* Text Domain: jeherve
* Domain Path: /languages/

Keybase proof

I hereby claim:

  • I am jeherve on github.
  • I am jeherve (https://keybase.io/jeherve) on keybase.
  • I have a public key ASAl-uJBAlYWAIQlao8U6zG1_YGVBgnxG-RXQjgUYZ_l0Qo

To claim this, I am signing this object:

@jeherve
jeherve / plugin.php
Last active April 8, 2016 00:47
[Jetpack] Add a default fallback image if no image can be found in a post
<?php
/*
* Plugin Name: Jetpack default image
* Plugin URI: http://wordpress.org/extend/plugins/
* Description: Add a default fallback image if no image can be found in a post
* Author: Jeremy Herve
* Version: 1.0
* Author URI: http://jeremyherve.com
* License: GPL2+
*/