Skip to content

Instantly share code, notes, and snippets.

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

Jeremy Herve jeherve

🚀
👨‍🏭
View GitHub Profile
@jeherve
jeherve / style.css
Created March 28, 2014 20:48
Facebook - No Ads - 03/2014
/* No Ads */
.rightColumnWrapper #pagelet_ego_pane {
display: none;
}
@jeherve
jeherve / plugin.php
Last active August 29, 2015 13:57
Custom home query - remove sticky posts
<?php
// Customize the loop on your home page only
function jeherve_custom_home_query( $query ) {
if ( ! $query->is_main_query() )
return;
if ( ! $query->is_home() || ! $query->is_front_page() || is_admin() )
return;
$query->set( 'ignore_sticky_posts', true );
@jeherve
jeherve / plugin.php
Created March 4, 2014 19:49
[Jetpack] Check of Tonesque's file is readable https://cloudup.com/cKET0dvWlaX
<?php
/*
* Plugin Name: Check Jetpack's Tonesque
* Plugin URI: http://wordpress.org/extend/plugins/jetpack/
* Description: Check if the Tonesque file is readable
* Author: Jeremy Herve
* Version: 1.0
* Author URI: http://jeremyherve.com
* License: GPL2+
*/
@jeherve
jeherve / plugin.php
Created February 28, 2014 18:19
[Jetpack] Related Posts: retrieve Related Posts manually, and return post titles
<?php
function jeherve_custom_related( $atts ) {
$posts_titles = array();
if ( class_exists( 'Jetpack_RelatedPosts' ) && method_exists( 'Jetpack_RelatedPosts', 'init_raw' ) ) {
$related = Jetpack_RelatedPosts::init_raw()
->set_query_name( 'jeherve-shortcode' ) // Optional, name can be anything
->get_for_post_id(
get_the_ID(),
array( 'size' => 3 )
@jeherve
jeherve / plugin.php
Last active July 3, 2019 09:15
[Jetpack] Deactivate Twitter Cards and / or Open Graph Meta tags.
<?php
/*
* Plugin Name: Disable Jetpack Open Graph tags and Twitter Cards
* Plugin URI: http://wordpress.org/extend/plugins/jetpack/
* Description: Disables Jetpack Open Graph tags
* Author: Jeremy Herve
* Version: 1.0
* Author URI: http://jeremyherve.com
* License: GPL2+
*/
@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'];
}
}