Skip to content

Instantly share code, notes, and snippets.

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

Jeremy Herve jeherve

🚀
👨‍🏭
View GitHub Profile
@jeherve
jeherve / header.php
Created April 6, 2012 00:41
[Facebook & WordPress] Add Open Graph data to your header
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml" prefix="og: http://ogp.me/ns#" <?php language_attributes(); ?>>
<?php if (have_posts()):while(have_posts()):the_post();endwhile;endif;?>
<!-- Facebook Opengraph -->
<meta property="fb:app_id" content="your_app_id" />
<meta property="fb:admins" content="your_admin_id" />
<meta property="og:url" content="<?php the_permalink() ?>"/>
<?php if (is_single()) { ?>
<meta property="og:title" content="<?php single_post_title(''); ?>" />
<meta property="og:description" content="<?php echo strip_tags(get_the_excerpt($post->ID)); ?>" />
<meta property="og:type" content="article" />
@jeherve
jeherve / single.php
Created May 15, 2012 20:10
[Quora] How do I insert a rel=author into my get_the_tags call in WordPress?
<?php
$posttags = get_the_tags();
if ($posttags) {
foreach($posttags as $tag) {
echo '<a rel=author href="' . $tag->slug . '">' . $tag->name . '</a>';
}
}
?>
@jeherve
jeherve / jp-rm-minileven-sidebar.php
Created January 14, 2013 10:36
[Jetpack] How to disable the sidebar in Jetpack Mobile Theme http://i.wpne.ws/M9qL
<?php
/*
* Plugin Name: Jetpack Deactivate Mobile Theme Sidebar
* Plugin URI: http://wordpress.org/extend/plugins/jetpack/
* Description: Deactivate the sidebar in Jetpack's Mobile Theme
* Author: Jeremy Herve
* Version: 1.0
* Author URI: http://jeremyherve.com
* License: GPL2+
*/
@jeherve
jeherve / jp-disable-og.php
Created January 14, 2013 10:39
[Jetpack] How to disable Jetpack Open Graph tags http://i.wpne.ws/M7Le
<?php
/*
* Plugin Name: Disable Jetpack Open Graph tags
* 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 / jp-rm-jpmenu.php
Last active November 27, 2016 10:44
[Jetpack] How to hide the Jetpack menu to all non-admins https://github.com/jeherve/jetpack-addons/archive/jetpack-admins.zip
<?php
/*
* Plugin Name: Jetpack Only for Admins
* Plugin URI: http://wordpress.org/extend/plugins/
* Description: Hides the Jetpack menu for all non-admins
* Author: Jeremy Herve
* Version: 1.1
* Author URI: http://jeremyherve.com
* License: GPL2+
* Text Domain: jetpack
@jeherve
jeherve / jp-sd-custshortlink.php
Created January 26, 2013 18:18
[Jetpack] Use shortlinks instead of permalinks in sharing buttons http://i.wpne.ws/2H081K2L3Q0u
@jeherve
jeherve / style.css
Created February 6, 2013 07:27
[Custom Post Widget] Hide Sharing buttons
.widget_custom_post_widget .sharedaddy {
display:none;
}
@jeherve
jeherve / jp-rm-cleaner-gallery.php
Created February 9, 2013 09:26
[Jetpack] Disable Hybrid themes' Cleaner Gallery, so that Carousel and Tiled Galleries can work http://i.wpne.ws/MkjU
@jeherve
jeherve / content.php
Created February 19, 2013 11:35
Tweak the "Read More" link on the page Changes for Twenty Eleven
<?php if ( is_search() ) : // Only display Excerpts for Search ?>
<div class="entry-summary">
<?php the_excerpt(); ?>
</div><!-- .entry-summary -->
<?php elseif ( is_home() ) : // Only Edit the "Read More" link on the home page ?>
<div class="entry-content">
<?php the_content( __( 'Vous voulez en savoir plus ?', 'twentyeleven' ) ); ?>
<?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?>
</div><!-- .entry-content -->
<?php else : ?>
@jeherve
jeherve / style.css
Created February 20, 2013 14:26
Customize Subscription form
/* Jetpack Subscriptions widget
------------------------------------------------------------ */
#header .jetpack_subscription_widget {
-moz-box-shadow: 0 0 5px #999;
-webkit-box-shadow: 0 0 5px #999;
background-color: #b2c802;
border: 4px solid #fff;
border-radius: 10px;
box-shadow: 0 0 5px #999;