Skip to content

Instantly share code, notes, and snippets.

🚀
👨‍🏭

Jeremy Herve jeherve

🚀
👨‍🏭
View GitHub Profile
@jeherve
jeherve / header.php
Created Apr 6, 2012
[Facebook & WordPress] Add Open Graph data to your header
View header.php
<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
[Quora] How do I insert a rel=author into my get_the_tags call in WordPress?
View single.php
<?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 Jan 14, 2013
[Jetpack] How to disable the sidebar in Jetpack Mobile Theme http://i.wpne.ws/M9qL
View jp-rm-minileven-sidebar.php
<?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 Jan 14, 2013
[Jetpack] How to disable Jetpack Open Graph tags http://i.wpne.ws/M7Le
View jp-disable-og.php
<?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+
*/
View jp-rm-jpmenu.php
<?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 Jan 26, 2013
[Jetpack] Use shortlinks instead of permalinks in sharing buttons http://i.wpne.ws/2H081K2L3Q0u
View jp-sd-custshortlink.php
@jeherve
jeherve / style.css
Created Feb 6, 2013
[Custom Post Widget] Hide Sharing buttons
View style.css
.widget_custom_post_widget .sharedaddy {
display:none;
}
@jeherve
jeherve / jp-rm-cleaner-gallery.php
Created Feb 9, 2013
[Jetpack] Disable Hybrid themes' Cleaner Gallery, so that Carousel and Tiled Galleries can work http://i.wpne.ws/MkjU
View jp-rm-cleaner-gallery.php
@jeherve
jeherve / content.php
Created Feb 19, 2013
Tweak the "Read More" link on the page Changes for Twenty Eleven
View content.php
<?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 Feb 20, 2013
Customize Subscription form
View style.css
/* 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;
You can’t perform that action at this time.