Luxo Jr. Costume
october 2011 by citizenk
Tagged: awesome, costume, gifs, luxo jr., pixar Submitted by:
TSGIGOR
Via: www.youtube.com
Clever_Disguise
Image
awesome
costume
gifs
luxo_jr.
pixar
from google
TSGIGOR
Via: www.youtube.com
october 2011 by citizenk
Suck it Alien
october 2011 by citizenk
Demotivate or Caption This!
Submitted by:
darkly39
Image
WTF
alien
art
baby
chest_burster
from google
Submitted by:
darkly39
october 2011 by citizenk
Skate Boarding Practice
september 2011 by citizenk
Tagged: art, gifs, i have the weirdest boner, rolling, wtf Submitted by: Unknown
Image
Mindwarp
art
gifs
i_have_the_weirdest_boner
rolling
wtf
from google
september 2011 by citizenk
CSI: Seems Legit
september 2011 by citizenk
Submitted by:
diablo7
Image
TV
awww_yea
CSI
enhance
seems_legit
from google
diablo7
september 2011 by citizenk
Fossils: How Do They Work?
august 2011 by citizenk
Comic by:
themaxthoams
Image
the_internets
christianity
creationism
evolution
futurama
live_on_this_planet
from google
themaxthoams
august 2011 by citizenk
LIKE A BOSS
july 2011 by citizenk
LIKE A BOSS
Submitted by: Unknown
Hilarious
Image
motorcycle
pushing
sexy_ladies
wtf
from google
Submitted by: Unknown
july 2011 by citizenk
What Memes May Come
july 2011 by citizenk
Tagged: gifs, memes, people, reenactment Submitted by: Unknown
Image
The_Interwebz
memes
gifs
people
reenactment
from google
july 2011 by citizenk
Today Is Not His Day…
july 2011 by citizenk
…and then it was nobody’s day.
Comic by:
koaieus
Creepy_Sneakers
Image
Group_photo
laughing
serious_face
that_guy
from google
Comic by:
koaieus
july 2011 by citizenk
WHEN I WAS YOUNG
july 2011 by citizenk
WHEN I WAS YOUNG
you didn’t have to tell kids not to try this at home. we weren’t complete retards back then.
idiots
Image
kids
wile_e_coyote
from google
you didn’t have to tell kids not to try this at home. we weren’t complete retards back then.
july 2011 by citizenk
B*TCH PLEASE
june 2011 by citizenk
B*TCH PLEASE
I’m 50 Cent
Submitted by:
Lodan82
Image
Pure_Awesome
50_cent
accordian
wtf
from google
I’m 50 Cent
Submitted by:
Lodan82
june 2011 by citizenk
I Call it, “i”
june 2011 by citizenk
Submitted by: kayozia
celebutard
Image
apple
ipad
iphone
mac
Steve_Jobs
from google
june 2011 by citizenk
Photo Gallery Primer
may 2011 by citizenk
I have seen many questions from people about how to create photo galleries in WordPress. But often I see these questions answered by somebody recommending a plugin or something like that. You don’t really need plugins to create photo galleries. WordPress has a huge amount of gallery functionality built right in. You just need to make your theme smarter in order to take advantage of it.
Note: Matt has one of the neatest photo gallery implementations around, and he often gets questions about it. So I’m going to refer to it from time to time in this post. Maybe you’ll want to head over there and familiarize yourself with some of the look and features of it.
Understanding the Gallery Concept
One of the first things you need to know is how WordPress organizes Galleries. A gallery is really just a post with a bunch of images attached to it.
While editing a post or creating a new one, you have the option to upload images or other files. When you upload a file through the file Uploader, WordPress creates a post just for that file. This post has a post_type of “attachment”. Images in particular get some extra processing, and they show up in multiple sizes, you can insert them into the posts, etc. You probably already knew that. You probably have seen the gallery inserter, which just inserts the “gallery” shortcode into your post.
What you might not have known is that it’s doing more than you think. It’s not just resizing those images you’re uploading, but it’s pulling out metadata and other information about the image too. It’s grabbing alot of the EXIF data from the image and storing it as postmeta items for that attachment post. The post itself, being a post, gets its own URL, which is the post that it is attached to’s URL followed by the attachment posts title. Basically, an attachment post is sorta like a child of the parent post, which contains the gallery. So all a gallery really is is the sum of the attachments posts that are children of the gallery post itself.
Graph of the Gallery concept
Is that clear as mud? Don’t worry, it’s simpler to work with than you think.
Create an Image Template
First thing you need to do is to edit your theme (or create a child theme, if you prefer). What you’re going to do is to make an “image.php” file.
(Side note: If you browse through the source of WordPress, you’ll never find where it loads the “image.php” file, because it isn’t there. What it is actually doing is looking for the mimetype of the attachment as a filename. So since you uploaded, say, a JPG file, then the mimetype is image/jpeg. It splits that and looks for image.php, followed by jpeg.php, followed by image_jpeg.php, and finally just attachment.php as the generic base. It does this for any and all attachments, and any and all mime types. So you can have a video.php for video attachments, audio.php for audio attachments, etc.)
The image.php file is the template that will load for “single images”. A gallery shows thumbnails, but when you click on them, you go to the attachment page for just that image. An easy way to start with your custom image page is to copy your existing single post page to it. Just copy single.php to image.php. If you don’t have a single.php, maybe you should try copying the index.php file instead.
Modify your Image Template
Since this is an image, it’s going to have things in it that normal posts don’t. It’s also going to need special navigational entries that other posts don’t have.
For starters, it has a parent, which is the post containing the gallery. So what if we want to display the gallery post’s name? Easy, we can reference the parent using $post->post_parent. So code like get_the_title($post->post_parent) will get us that title so we can echo it. Similarly, using something like get_permalink($post->post_parent) will get us the link back to the gallery. So this sort of code in our image template will display that link:
echo "<a href='" . get_permalink($post->post_parent). "'>Go back to ". get_the_title($post->post_parent) ."</a>";
For navigation, we have special functions. previous_image_link and next_image_link will let us display links to the previous or next images in the gallery order. Each of these takes two parameters. The first is the size of the previous or next image we want to display (or false to not show a thumbnail at all), the second optional parameter is some text to put in the link. So to show a couple of text navigational links, this code would work:
echo previous_image_link(false,'Previous Photo');
echo next_image_link(false,'Next Photo');
If I wanted to display image links instead, I could change that false to ‘thumbnail’ to display the thumbnail sized images. Or ‘medium’. Or whatever size I preferred.
Next we want to display the image. The wp_get_attachment_image function takes care of that easily:
echo wp_get_attachment_image( $post->ID, 'medium' );
The second parameter there is the size we want to display it at. You could also use ‘large’, ‘full’, ‘thumbnail’, etc. Any of the image sizes. If you want the image to be clickable, you might wrap it in an A tag and link it to the image itself.
But remember that attachment posts are still posts. All those fields you can enter on the image uploader are available to you to use. For example, the “Title” is stored in the normal Post Title field, so calling the_title() will display that. The Description is stored in the Content field and can be displayed with the_content(). The Caption is stored in the Excerpt field and can be displayed with the_excerpt(). You should use these as needed.
EXIF Information
Here’s an example of one of Matt’s single image pages, showing a balloon: http://ma.tt/2011/05/balloon-ride/mcm_9033/.
Nice shot. Scroll down a bit and look on the right hand side of that page, where it says INFO. Lots of nifty information there. But he didn’t put any of that in, WordPress did it all by itself.
To gain access to that information in your image.php file, you use this code:
$imagemeta = wp_get_attachment_metadata();
If you examine this array, you find that it contains widths, heights, filenames of the various sizes of thumbnails generated, etc. But it also contains an array called “image_meta”. This is an array of information that represents everything WordPress was able to glean from the image itself. After you know this, it’s just a matter of displaying it properly.
For example, to display the camera name, he has code similar to this:
if ($imagemeta['image_meta']['camera']) {
echo "Camera: " . $imagemeta['image_meta']['camera'];
}
There’s other bits in there, like Aperture, Focal Length, ISO settings, and Shutter Speed. Most of these are straightforward, except for shutter speed which is often not in an easy format to display. Usually it’s a fractional value, represented as a decimal. Often we want to convert this to the fractional display. Here’s a bit of code I wrote to do that. It’s not perfect, but what is?
if ($imagemeta['image_meta']['shutter_speed']) {
echo 'Shutter: ';
// shutter speed handler
if ((1 / $imagemeta['image_meta']['shutter_speed']) > 1) {
echo "1/";
if (number_format((1 / $imagemeta['image_meta']['shutter_speed']), 1) == number_format((1 / $imagemeta['image_meta']['shutter_speed']), 0)) {
echo number_format((1 / $imagemeta['image_meta']['shutter_speed']), 0, '.', '') . ' sec';
} else {
echo number_format((1 / $imagemeta['image_meta']['shutter_speed']), 1, '.', '') . ' sec';
}
} else {
echo $imagemeta['image_meta']['shutter_speed'].' sec';
}
}
Ugly, I know, but it gets the job done, more or less. Works on most shutter speeds I’ve tested it with.
Gallery Formatting in the Stream
Now, obviously you want your posts to look good in the normal flow of the blog as well. Twenty-Ten and the upcoming Twenty-Eleven themes both show you how to do this rather easily. Twenty-Ten used the “gallery” category for this at one point, before Post Formats came along and made that method obsolete. Now it uses the gallery post format instead.
So first, obviously, your theme will need to support the gallery post format. This is easy, just add this to your theme’s functions.php if it doesn’t have gallery support already (or add “gallery” to it if it does have post format support).
add_theme_support( 'post-formats', array( 'gallery') );
Now that that’s done, you have the option of choosing gallery as a post format. So you need to edit your theme to use that flag as an indicator to display things differently.
There’s plenty of tutorials on post formats out there, so I’ll assume you’re more than capable of figuring out how to use has_post_format(‘gallery’) or the “.home .format-gallery” CSS indicators to style the posts as needed.
What you need to know for specific gallery formatting in the main stream of the blog is how to display a selected representative image from the gallery there instead of the whole thing. There’s two basic steps to this.
First, you have to write your post appropriately to begin with. Take one of Matt’s posts for example: http://ma.tt/2011/05/20/
Here’s how that post actually looks in the editor:
Description text at the top here... Went for balloon ride, etc.
< !--more-- >
[ gallery ]
In other words, he puts the description first, then the more tag, then the gallery after it. This has the effect of giving a natural separation of the description content and the gallery itself. The gallery is not displayed on the front page, because it’s after the more tag. So a call to the_content() on the stream pages will only show the description.
Secondly, you can easily adapt the Featured Image function to let you choose which image to display in the stream. All the user has to do is to upload their gallery then select one and set it to be the featured image. Voila, it’ll be the main represent[…]
Code
WordPress
attachments
gallery
image
pages
posts
from google
Note: Matt has one of the neatest photo gallery implementations around, and he often gets questions about it. So I’m going to refer to it from time to time in this post. Maybe you’ll want to head over there and familiarize yourself with some of the look and features of it.
Understanding the Gallery Concept
One of the first things you need to know is how WordPress organizes Galleries. A gallery is really just a post with a bunch of images attached to it.
While editing a post or creating a new one, you have the option to upload images or other files. When you upload a file through the file Uploader, WordPress creates a post just for that file. This post has a post_type of “attachment”. Images in particular get some extra processing, and they show up in multiple sizes, you can insert them into the posts, etc. You probably already knew that. You probably have seen the gallery inserter, which just inserts the “gallery” shortcode into your post.
What you might not have known is that it’s doing more than you think. It’s not just resizing those images you’re uploading, but it’s pulling out metadata and other information about the image too. It’s grabbing alot of the EXIF data from the image and storing it as postmeta items for that attachment post. The post itself, being a post, gets its own URL, which is the post that it is attached to’s URL followed by the attachment posts title. Basically, an attachment post is sorta like a child of the parent post, which contains the gallery. So all a gallery really is is the sum of the attachments posts that are children of the gallery post itself.
Graph of the Gallery concept
Is that clear as mud? Don’t worry, it’s simpler to work with than you think.
Create an Image Template
First thing you need to do is to edit your theme (or create a child theme, if you prefer). What you’re going to do is to make an “image.php” file.
(Side note: If you browse through the source of WordPress, you’ll never find where it loads the “image.php” file, because it isn’t there. What it is actually doing is looking for the mimetype of the attachment as a filename. So since you uploaded, say, a JPG file, then the mimetype is image/jpeg. It splits that and looks for image.php, followed by jpeg.php, followed by image_jpeg.php, and finally just attachment.php as the generic base. It does this for any and all attachments, and any and all mime types. So you can have a video.php for video attachments, audio.php for audio attachments, etc.)
The image.php file is the template that will load for “single images”. A gallery shows thumbnails, but when you click on them, you go to the attachment page for just that image. An easy way to start with your custom image page is to copy your existing single post page to it. Just copy single.php to image.php. If you don’t have a single.php, maybe you should try copying the index.php file instead.
Modify your Image Template
Since this is an image, it’s going to have things in it that normal posts don’t. It’s also going to need special navigational entries that other posts don’t have.
For starters, it has a parent, which is the post containing the gallery. So what if we want to display the gallery post’s name? Easy, we can reference the parent using $post->post_parent. So code like get_the_title($post->post_parent) will get us that title so we can echo it. Similarly, using something like get_permalink($post->post_parent) will get us the link back to the gallery. So this sort of code in our image template will display that link:
echo "<a href='" . get_permalink($post->post_parent). "'>Go back to ". get_the_title($post->post_parent) ."</a>";
For navigation, we have special functions. previous_image_link and next_image_link will let us display links to the previous or next images in the gallery order. Each of these takes two parameters. The first is the size of the previous or next image we want to display (or false to not show a thumbnail at all), the second optional parameter is some text to put in the link. So to show a couple of text navigational links, this code would work:
echo previous_image_link(false,'Previous Photo');
echo next_image_link(false,'Next Photo');
If I wanted to display image links instead, I could change that false to ‘thumbnail’ to display the thumbnail sized images. Or ‘medium’. Or whatever size I preferred.
Next we want to display the image. The wp_get_attachment_image function takes care of that easily:
echo wp_get_attachment_image( $post->ID, 'medium' );
The second parameter there is the size we want to display it at. You could also use ‘large’, ‘full’, ‘thumbnail’, etc. Any of the image sizes. If you want the image to be clickable, you might wrap it in an A tag and link it to the image itself.
But remember that attachment posts are still posts. All those fields you can enter on the image uploader are available to you to use. For example, the “Title” is stored in the normal Post Title field, so calling the_title() will display that. The Description is stored in the Content field and can be displayed with the_content(). The Caption is stored in the Excerpt field and can be displayed with the_excerpt(). You should use these as needed.
EXIF Information
Here’s an example of one of Matt’s single image pages, showing a balloon: http://ma.tt/2011/05/balloon-ride/mcm_9033/.
Nice shot. Scroll down a bit and look on the right hand side of that page, where it says INFO. Lots of nifty information there. But he didn’t put any of that in, WordPress did it all by itself.
To gain access to that information in your image.php file, you use this code:
$imagemeta = wp_get_attachment_metadata();
If you examine this array, you find that it contains widths, heights, filenames of the various sizes of thumbnails generated, etc. But it also contains an array called “image_meta”. This is an array of information that represents everything WordPress was able to glean from the image itself. After you know this, it’s just a matter of displaying it properly.
For example, to display the camera name, he has code similar to this:
if ($imagemeta['image_meta']['camera']) {
echo "Camera: " . $imagemeta['image_meta']['camera'];
}
There’s other bits in there, like Aperture, Focal Length, ISO settings, and Shutter Speed. Most of these are straightforward, except for shutter speed which is often not in an easy format to display. Usually it’s a fractional value, represented as a decimal. Often we want to convert this to the fractional display. Here’s a bit of code I wrote to do that. It’s not perfect, but what is?
if ($imagemeta['image_meta']['shutter_speed']) {
echo 'Shutter: ';
// shutter speed handler
if ((1 / $imagemeta['image_meta']['shutter_speed']) > 1) {
echo "1/";
if (number_format((1 / $imagemeta['image_meta']['shutter_speed']), 1) == number_format((1 / $imagemeta['image_meta']['shutter_speed']), 0)) {
echo number_format((1 / $imagemeta['image_meta']['shutter_speed']), 0, '.', '') . ' sec';
} else {
echo number_format((1 / $imagemeta['image_meta']['shutter_speed']), 1, '.', '') . ' sec';
}
} else {
echo $imagemeta['image_meta']['shutter_speed'].' sec';
}
}
Ugly, I know, but it gets the job done, more or less. Works on most shutter speeds I’ve tested it with.
Gallery Formatting in the Stream
Now, obviously you want your posts to look good in the normal flow of the blog as well. Twenty-Ten and the upcoming Twenty-Eleven themes both show you how to do this rather easily. Twenty-Ten used the “gallery” category for this at one point, before Post Formats came along and made that method obsolete. Now it uses the gallery post format instead.
So first, obviously, your theme will need to support the gallery post format. This is easy, just add this to your theme’s functions.php if it doesn’t have gallery support already (or add “gallery” to it if it does have post format support).
add_theme_support( 'post-formats', array( 'gallery') );
Now that that’s done, you have the option of choosing gallery as a post format. So you need to edit your theme to use that flag as an indicator to display things differently.
There’s plenty of tutorials on post formats out there, so I’ll assume you’re more than capable of figuring out how to use has_post_format(‘gallery’) or the “.home .format-gallery” CSS indicators to style the posts as needed.
What you need to know for specific gallery formatting in the main stream of the blog is how to display a selected representative image from the gallery there instead of the whole thing. There’s two basic steps to this.
First, you have to write your post appropriately to begin with. Take one of Matt’s posts for example: http://ma.tt/2011/05/20/
Here’s how that post actually looks in the editor:
Description text at the top here... Went for balloon ride, etc.
< !--more-- >
[ gallery ]
In other words, he puts the description first, then the more tag, then the gallery after it. This has the effect of giving a natural separation of the description content and the gallery itself. The gallery is not displayed on the front page, because it’s after the more tag. So a call to the_content() on the stream pages will only show the description.
Secondly, you can easily adapt the Featured Image function to let you choose which image to display in the stream. All the user has to do is to upload their gallery then select one and set it to be the featured image. Voila, it’ll be the main represent[…]
may 2011 by citizenk
Well That’s Weird…
may 2011 by citizenk
Comic by: DonManoy
cartoons
Image
cartoon
Disney
royal_wedding
wtf
from google
may 2011 by citizenk
Why blurring sensitive information is a bad idea - dheera.net: Dheera Venkatraman's web site
november 2007 by citizenk
Remember, you want to leave your visitors with NO information, not blurred information.
security
hack
images
technology
image
information
november 2007 by citizenk
PXLGFX- Polished Text
november 2006 by citizenk
Make your text seem as if it is spankin' new, right out of the package
web2.0
tutorial
photoshop
image
title
typography
web-dev
graphism
november 2006 by citizenk
related tags
50_cent ⊕ accordian ⊕ alien ⊕ animals ⊕ apple ⊕ archeology ⊕ architecture ⊕ art ⊕ article ⊕ attachments ⊕ awesome ⊕ awww_yea ⊕ baby ⊕ cartoon ⊕ cartoons ⊕ Celebrity ⊕ celebutard ⊕ chest_burster ⊕ christianity ⊕ Clever_Disguise ⊕ Code ⊕ cool ⊕ costume ⊕ crab ⊕ creationism ⊕ Creepy_Sneakers ⊕ CSI ⊕ dancing ⊕ difference ⊕ Disney ⊕ enhance ⊕ evolution ⊕ flickr ⊕ format ⊕ funny ⊕ futurama ⊕ gallery ⊕ generator ⊕ gif ⊕ gifs ⊕ glass ⊕ graphics ⊕ graphism ⊕ Group_photo ⊕ hack ⊕ Hilarious ⊕ humour ⊕ hybrids ⊕ idiots ⊕ image ⊖ images ⊕ information ⊕ ipad ⊕ iphone ⊕ i_have_the_weirdest_boner ⊕ jpeg ⊕ jpg ⊕ kids ⊕ laughing ⊕ lightning ⊕ live_on_this_planet ⊕ LMFAO ⊕ luxo_jr. ⊕ mac ⊕ manipulation ⊕ memes ⊕ Mindwarp ⊕ mosaic ⊕ motorcycle ⊕ music ⊕ nature ⊕ pages ⊕ party ⊕ people ⊕ photo ⊕ photography ⊕ photoshop ⊕ picture ⊕ pictures ⊕ pixar ⊕ png ⊕ posts ⊕ Pure_Awesome ⊕ pushing ⊕ reenactment ⊕ reference ⊕ religion ⊕ resize ⊕ robot ⊕ rolling ⊕ royal_wedding ⊕ science ⊕ security ⊕ seems_legit ⊕ serious_face ⊕ sexy_ladies ⊕ shell ⊕ slowmotion ⊕ Steve_Jobs ⊕ technology ⊕ that_guy ⊕ the_internets ⊕ The_Interwebz ⊕ title ⊕ tools ⊕ tutorial ⊕ TV ⊕ typography ⊕ urban ⊕ weather ⊕ web-dev ⊕ web-tool ⊕ web2.0 ⊕ wile_e_coyote ⊕ WordPress ⊕ wtf ⊕Copy this bookmark: