Membership is FREE, giving all registered users unlimited access to every Acorn Domains feature, resource, and tool! Optional membership upgrades unlock exclusive benefits like profile signatures with links, banner placements, appearances in the weekly newsletter, and much more - customized to your membership level!

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.

The Rule #1

Do not insult any other member. Be polite and do business. Thank you!

Premium Members

Latest Comments

New Threads

Domain Forum Friends

Our Mods' Businesses

*the exceptional businesses of our esteemed moderators
General chit-chat
Help Users
  • No one is chatting at the moment.
      There are no messages in the current room.
      Top Bottom