Domain Manage

wordpress - pulling images from affiliate feed

Discussion in 'Wordpress' started by seanc, Jul 18, 2010.

Thread Status:
Not open for further replies.
  1. seanc United Kingdom

    seanc Well-Known Member

    Joined:
    May 2005
    Posts:
    1,202
    Likes Received:
    6
    some wordpress themes do pull images from affiliate feeds (remote images)
    some dont.

    i have a theme that i want to use that doesnt show the thumbnails.

    anyone help? is there some code i can add to my theme to pull the images in?

    tia
     
  2. Domain Forum

    Acorn Domains Elite Member

    Joined:
    1999
    Messages:
    Many
    Likes Received:
    Lots
     
  3. fresh79 United Kingdom

    fresh79 Active Member

    Joined:
    Mar 2008
    Posts:
    455
    Likes Received:
    5
    create a custom field called full-image

    put this in your loop just under the part that checks if have posts
    PHP:
    <?php
    // check for thumbnail
    $thumb get_post_meta($post->ID'full-image'$single true);
    // check for thumbnail class
    $thumb_class get_post_meta($post->ID'Thumbnail Class'$single true);
    // check for thumbnail alt text
    $thumb_alt get_post_meta($post->ID'Thumbnail Alt'$single true);
    ?>
    and this part where you want the image (before or after the content)
    PHP:
    <?php // if there's a thumbnail
    if($thumb !== '') { ?>
    <a href="<?php the_permalink() ?>">
    <img src="<?php echo $thumb?>" class="<?php if($thumb_class !== '') { echo $thumb_class; } else { echo "floatleft-thumb"; } ?>"
    alt="<?php if($thumb_alt !== '') { echo $thumb_alt; } else { echo the_title(); } ?>"
    /></a>

    <?php // end if statement
    // if there's not a thumbnail
    else { echo ''; } ?>
    style it using css and its class floatleft-thumb
     
Thread Status:
Not open for further replies.

Share This Page