Well, I found about two dozens of different plugins and other crap that promised to extract the first image of every post in Wordpress. This feature was crucial for my upcoming portfolio webpage, so I went on digging deeper. Thankfully I found the Blog Mum blog which gave me a profound yet creative solution. However, I had to have the height and width of my images(divs with background actually) embedded into the div’s style in order for my slider to work correctly. Thats when I made some adjustments to the code. This is my first time messing with wordpress script on this level so please excuse my PHP.
Functions.php hase this:
// Retrieve the src of first image in a post
function bm_extract_string($start, $end, $original) { $original = stristr($original, $start); $trimmed = stristr($original, $end); return substr($original, strlen($start), -strlen($trimmed)); } function getFirstImage() { $content = get_the_content(); $pic_string = bm_extract_string(’src=”‘,’” ‘,$content); $imagesize = getimagesize($pic_string); list($width, $height, $type, $attr) = getimagesize($pic_string); echo ‘< a href=”’.$link.’” style=”background:url(‘.$pic_string.’); display:block; width:’.$width.’px; height:’.$height.’px;”></a> ‘; }
and inside your index.php simply put this:
<?php getFirstImage(); ?>
Fluid Sculpture by Charlie Bucket. Visit his domain page at [← casualprofanity.com →] for many more samples of his liquid-tubing experiments.
When I saw this video for the first time I immediately though that this technique could be used to bend intravenous(I.V.) tubing into shape, for a more decadent effect. Something that Marilyn Manson might appreciate.
Today I was happy to discover that many of Michel Foucault’s (on whom my thesis banks heavily) text are freely available “for educational purpose, under fair use of the Berne Convention”. The repository is “[o]nline since 1998 […and now welcomes…] 50.000 readers every month.”
For those that don’t know:
“Michel Foucault (French pronunciation: [miʃɛl fuko]) (15 October 1926 – 25 June 1984) was a French philosopher, historian, critic and sociologist.”
[← read on at wikipedia →]