Skip to content

Instantly share code, notes, and snippets.

Paul van Buuren paulvanbuuren

Block or report user

Report or block paulvanbuuren

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@paulvanbuuren
paulvanbuuren / WordPress: Require Featured Image
Created Feb 10, 2015
WordPress: Require Featured Image
View WordPress: Require Featured Image
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;
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
*
@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');
@paulvanbuuren
paulvanbuuren / gist:392014094eb6f9f0006423442fc0595c
Created Jan 31, 2018
WordPress - tweaking the tinyMCE editor
View gist:392014094eb6f9f0006423442fc0595c
/*
* Modifying TinyMCE editor to remove unused items.
*/
function wbvb_wpadmin_adjust_tinymce_options( $settings ) {
// remove pointless layout options:
$settings['theme_advanced_disable'] = 'underline,spellchecker,forecolor,justifyfull';
$settings['theme_advanced_buttons2_add'] = 'styleselect';
View gist:f828d75785bcc4ad931860ed79726a9c
define( 'ANIMATIONCOOKIEKEY', 'mag_animatie_tonen' );
//========================================================================================================
add_action( 'init', 'gist_check_if_cookies_are_enabled' );
//========================================================================================================
View gist:995328ca6b025199b0ea
Verifying that +paulvanbuuren is my blockchain ID. https://onename.com/paulvanbuuren
@paulvanbuuren
paulvanbuuren / WordPress: Featured Images in RSS Feed
Last active Aug 29, 2015
WordPress: Featured Images in RSS Feed
View WordPress: Featured Images in RSS Feed
@paulvanbuuren
paulvanbuuren / WordPress: Add Logo to Admin Page
Created Feb 10, 2015
WordPress: Add Logo to Admin Page
View WordPress: Add Logo to Admin Page
// from: http://www.codeinwp.com/blog/wordpress-image-code-snippets/
// ============================================================================
// If you’re going to add your logo to the login page, you may as well top things off by adding to the admin page too, right?
// Just add the following code and upload your logo (again, feel free to change the file location to suit):
// ============================================================================
function custom_admin_logo() {
echo '<style type="text/css">
#header-logo { background-image: url('.get_bloginfo('template_directory').'/images/admin_logo.png) !important; }
@paulvanbuuren
paulvanbuuren / WordPress: Remove Automatic JPEG Compression
Created Feb 10, 2015
WordPress: Remove Automatic JPEG Compression
View WordPress: Remove Automatic JPEG Compression
// from: http://www.codeinwp.com/blog/wordpress-image-code-snippets/
// ============================================================================
// WordPress: Remove Automatic JPEG Compression
// ============================================================================
add_filter( 'jpeg_quality', 'smashing_jpeg_quality' );
function smashing_jpeg_quality() {
return 100;
}
You can’t perform that action at this time.