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. 🚫 No AI-generated (LLM) posts allowed. Share your own thoughts and experience — accounts may be terminated for violations.

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.

Rule #1: Be Respectful

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

Premium Members

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.
  • Siusaidh AcornBot:
    Siusaidh has left the room.
      Siusaidh AcornBot: Siusaidh has left the room.
      Top Bottom