Skip to content

Instantly share code, notes, and snippets.

Avatar

Paul van Buuren paulvanbuuren

View GitHub Profile
@paulvanbuuren
paulvanbuuren / gist:2afebf8607452adcc1d416809e4029b0
Created Mar 5, 2018
How to remove the WordPress emoji cruft
View gist:2afebf8607452adcc1d416809e4029b0
/* THX: https://www.denisbouquet.com/remove-wordpress-emoji-code/ */
//========================================================================================================
// In functions.php (your WordPress theme)
// Add the following lines
// REMOVE WP EMOJI
remove_action('wp_head', 'print_emoji_detection_script', 7);
remove_action('wp_print_styles', 'print_emoji_styles');
View gist:266d2bc439f04bc93aa7fe8a0330db30
<?php
//========================================================================================================
// add a filter for Genesis framework post titles
add_filter( 'genesis_post_title_text', 'wbvb_example_use_seo_title', 15 );
/**
* If a Yoast SEO title is found for a post, return this title after parsing it
*
View WordPress: get post ID for slug
/**
* Retrieve a post ID for a slug and post type
*/
function get_postid_by_slug( $page_slug = '', $posttype = 'post' ) {
if ( $page_slug ) {
$postobject = get_page_by_path( $page_slug, OBJECT, $posttype );
if ( $postobject ) {
return $postobject->ID;
@paulvanbuuren
paulvanbuuren / WordPress: Require Featured Image
Created Feb 10, 2015
WordPress: Require Featured Image
View WordPress: Require Featured Image
You can’t perform that action at this time.