How do I display the latest Flickr OAuth embedded image on the frontpage?

I have a Flickr category among my blogposts where I just paste in the direct links from Flickr, and let OAuth do it’s thing to hotlink/embed the photos in the post.

On my frontpage I am trying to grab the latest hotlinked/embedded photo from the latest post in the Flickr category in order to display it there. But with no success. I’ve tried with the get_the_image(); plugin, but it seems to only read photos that have been inserted into the post using the wordpress gallery.

Read More

I manage to get the_title();, so I know I’m accessing to the right category and post, but I don’t have any chance of displaying the image. Does anyone know how I can achieve this?

Update:
I’ve achieved this with the following code:

query_posts('category_name=flickr&showposts=1');
if ( have_posts() ) : while ( have_posts() ) : the_post();

$meta = get_post_custom();      
$photos = array();
foreach ($meta as $key => $value)
    if (false !== strpos($key, 'oembed'))
        array_push($photos, $value[0]);                 
    if(preg_match('/src="(.+.jpg)"/i', $photos[0], $m)) {
        echo '<img src="' . $m[1] . '" />';
    }

endwhile;
endif;

Unfortunatly that embeddes the full size image from Flickr. I tried combining it with TimThumb, but with no success. Small steps…

Related posts

Leave a Reply

1 comment