Skip to content

Instantly share code, notes, and snippets.

View notasausage's full-sized avatar
👨‍💻
Design + Code

Patrick Haney notasausage

👨‍💻
Design + Code
View GitHub Profile
@notasausage
notasausage / wp-custom-image-sizes.php
Last active June 28, 2024 00:32 — forked from iftee/wp-remove-default-image-sizes.php
Filter to remove default image sizes (WordPress & WooCommerce) from your theme and add custom image sizes instead.
<?php
/*
* WordPress filters to remove default image sizes and add custom sizes.
* Replace PREFIX with your theme's prefix as necessary.
* Regenerate thumbnails after adding this to your theme's functions.php file.
*/
// This function unsets the default image sizes
function PREFIX_remove_default_image_sizes( $sizes ) {
@notasausage
notasausage / get_twitter_avatar.php
Last active December 20, 2015 10:30 — forked from banksy89/gist:3334259
Return the profile image (avatar) of a Twitter user using their RSS feed (no API call necessary).
<?php
function getTwitterAvatar( $username, $size = "normal" ) {
// mini = 24px, normal = 48px, bigger = 73px
$sizes = array( "mini", "normal", "bigger" );
// Check for size, default to normal
if( in_array( $size, $sizes ) ) {
$variant = $size;
} else {
$variant = "normal";