Skip to content

Instantly share code, notes, and snippets.

View WazzaJB's full-sized avatar
🔺

Warren Bickley WazzaJB

🔺
View GitHub Profile
<?php
/**
* Filter the output of image_downsize() to return dynamically generated images for intermediate or inline sizes.
*
* <p>Because Wordpress generates all image sizes on first upload, if you change
* theme or size settings after the upload, there won't be a matching file for
* the requested size.<br/>
* This filter addresses the problem of the default downsize process laoding
* a large file and scaling it down in the browser if it doesn't find the right
* size image. This can cause large files to be loaded unnecessarily and will
@timkinnane
timkinnane / dynamic_image_downsize.php
Created February 2, 2015 08:49
Filter the output of image_downsize() to return dynamically generated images for intermediate or inline sizes. Long description in php doc block.
<?php
/**
* Filter the output of image_downsize() to return dynamically generated images for intermediate or inline sizes.
*
* <p>Because Wordpress generates all image sizes on first upload, if you change
* theme or size settings after the upload, there won't be a matching file for
* the requested size.<br/>
* This filter addresses the problem of the default downsize process laoding
* a large file and scaling it down in the browser if it doesn't find the right
* size image. This can cause large files to be loaded unnecessarily and will
@dalethedeveloper
dalethedeveloper / gist:1444480
Created December 7, 2011 20:26
Wordpress - Cross Taxonomy Tag List Query
<?php
/**
Echo a list of tags terms for posts that are also have a $where_tax of $where_slug
Queries added to transient cache for performance
Note: Using the slug for a Taxonomy in $where_slug for simpler query
Tested up to WP 3.3, drop it in your functions.php
Example: Get a tag list for Posts in the 'News' Category
tags_by_other_taxonomy('news');