Skip to content

Instantly share code, notes, and snippets.

@landsman
Last active August 2, 2016 00:03
Show Gist options
  • Save landsman/5e3e0dbcf13dc22e7798578cf22467a5 to your computer and use it in GitHub Desktop.
Save landsman/5e3e0dbcf13dc22e7798578cf22467a5 to your computer and use it in GitHub Desktop.
Wordpress remove emoji from head, Woocommerce functions
// EMOJI
remove_action( 'wp_print_styles', 'print_emoji_styles');
remove_action( 'wp_head','print_emoji_detection_script', 7);
// GENERATOR
add_action( 'get_the_generator_html', '_fc_return_null', 10, 2 );
add_action( 'get_the_generator_xhtml', '_fc_return_null', 10, 2 );
function _fc_return_null(){
return null;
}
/** Add wrapper for post thumbnail **/
add_filter('post_thumbnail_html', function( $html, $post_id, $post_thumbnail_id, $size, $attr )
{
ob_start();
?>
<span class="featured-image">
<a href="<?=get_the_permalink($post_id)?>">
<?=$html?>
</a>
</span>
<?php
return ob_get_clean();
}, 10, 5);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment