Skip to content

Instantly share code, notes, and snippets.

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

Jeremy Herve jeherve

🚀
👨‍🏭
View GitHub Profile
@jeherve
jeherve / plugin.php
Last active March 25, 2016 14:34
[Jetpack] Exclude certain categories from Jetpack Subscriptions
<?php
/*
* Plugin Name: Exclude the asmodeus category from Jetpack Subscriptions
* Plugin URI: http://wordpress.org/plugins/jetpack/
* Description: Exclude the asmodeus category from Jetpack Subscriptions
* Author: Jeremy Herve
* Version: 1.0
* Author URI: http://jeremyherve.com
* License: GPL2+
*/
@jeherve
jeherve / plugin.php
Last active March 1, 2016 07:30
[Themify Ultra / Jetpack's Photon module
<?php
/**
* The theme appears to be using its own function, `themify_get_image()`, to build image URLs used to display images above posts.
* It can grab image details (like dimensions) from custom fields in each post,
* and then builds a custom HTML output based on parameters you can add to the function.
*
* Photon won't be able to support that, so they'll need to make these images don't get processed by Photon at all.
*
* Add the following to a functionality plugin to force Photon to ignore such images
*/
@jeherve
jeherve / grep
Created January 24, 2014 09:54
[Jetpack] Count the number of filters in Jetpack
grep -o -r apply_filters * | wc -l
@jeherve
jeherve / style.css
Created December 18, 2013 18:09
[Woocommerce / Jetpack ] Get multiple columns for your products in Jetpack's Mobile Theme https://plus.google.com/u/0/106938199869823595443/posts/RWQuhehyf1X
.mobile-theme .hentry,
.mobile-theme .no-results {
clear: none;
}
@jeherve
jeherve / plugin.php
Created December 16, 2013 17:21
[Jetpack] Add the category name before the Publicize message More details: here: http://wordpress.org/support/topic/jetpack-publicize?replies=18#post-4836869
<?php
// Create our custom Publicize message
function jeherve_cust_pub_message() {
$post = get_post();
// Grab the first category of your post
if ( !empty( $post ) )
$categories = get_the_category( $post->ID );
@jeherve
jeherve / plugin.php
Created December 15, 2013 12:57
[Jetpack] Force the display of the snow
<?php
/*
Plugin Name: Moar snow!
Plugin URI: http://wordpress.org/plugins/jetpack/
Description: Force the display of Jetpack's snow on your site, even outside of the holiday season
Author: Jeremy Herve
Author URI: http://jeremyherve.com
Version: 1.0
*/
@jeherve
jeherve / plugin.php
Created December 10, 2013 11:16
[Jetpack] Get the number of subscribers on your site
<?php
// Get the number of subscribers on your site
function jeherve_sub_count() {
if ( class_exists( 'Jetpack_Subscriptions_Widget' ) ) {
$subcount = Jetpack_Subscriptions_Widget::fetch_subscriber_count();
echo $subcount['value'];
}
}
@jeherve
jeherve / plugin.php
Created December 2, 2013 19:26
[Jetpack] Jetpack's Development mode, to replace plugins like Slim Jetpack
<?php
add_filter( 'jetpack_development_mode', '__return_true' );
<?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 / plugin.php
Created October 22, 2013 14:26
[Jetpack] Remove Twitter Meta cards
<?php
function jeherve_remove_tw_tags() {
remove_filter( 'jetpack_open_graph_tags', 'wpcom_twitter_cards_tags' );
remove_filter( 'jetpack_open_graph_tags', 'change_twitter_site_param' );
}
add_action( 'template_redirect', 'jeherve_remove_tw_tags' );