Membership is FREE – with unlimited access to all features, tools, and discussions. Premium accounts get benefits like banner ads and newsletter exposure. ✅ Signature links are now free for all. Share your own thoughts and experience, accounts may be terminated for violations.
  • Welcome to AcornDomains.co.uk, a friendly community for UK domain investors, developers and anyone interested in domain names.

    Whether you're looking to buy or sell domains, learn more about the UK domain market, get feedback on your names, or simply chat with other domainers, you're in the right place. AcornDomains has been bringing together people from across the UK domain industry for many years, from complete beginners to experienced investors.

    Have a look around, join the discussions and, if you haven't already, create a free account and introduce yourself.

wordpress - pulling images from affiliate feed

Status
Not open for further replies.
Joined
May 20, 2005
Posts
1,197
Reaction score
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
 
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
 
Status
Not open for further replies.
Top Bottom