[wp-hackers] configure external url in functions?
Lee Rickler
info at a5d.org
Mon Apr 9 13:54:32 UTC 2012
Cheers John and fris.
Lee
On 8 Apr 2012, at 14:27, fris wrote:
> Frank posted something like this a couple days ago to swap out regular image
> urls for CDN.
>
> http://wordpress.stackexchange.com/a/553/70
>
>
> -----Original Message-----
> From: wp-hackers-bounces at lists.automattic.com
> [mailto:wp-hackers-bounces at lists.automattic.com] On Behalf Of Lee Rickler
> Sent: Sunday, April 08, 2012 8:45 AM
> To: wp-hackers at lists.automattic.com
> Subject: [wp-hackers] configure external url in functions?
>
> Not sure if this is possible, but it seems such a simple thing to implement
> so I may be missing the point.
>
> In the same way you can use bloginfo() or get_stylesheet_directory_uri() to
> specify a direct path is there a way to define an external URL so it can be
> included in the same way?
>
> As a general example, I want to pull an image from a CDN.
>
> To grab the image in the 'normal' theme folder you could simply write:
> <img src="<?php get_stylesheet_directory_uri(); ?>/images/image.png">
>
> but using the CDN I will have to use something like:
> <img src="https://s3.amazonaws.com/BUCKETNAME/images/image.png">
>
> What would be super extra spiffy is if I could use something like:
> <img src="<?php get_cdn_uri(); ?>/images/image.png">
>
> Possible? Newbie question? Completely off my rocker?
>
> Cheers,
>
> Lee
More information about the wp-hackers
mailing list