Custom field thumbnail in link for Previous Next Posts
-
In a bit of a follow-up to a previous question, I am currently using this bit of code on my main page to output thumbnails above each post title from a custom field, unless there is none, in which case I use a default:
<a href="<?php the_permalink(); ?>" title="" rel="bookmark"> <?php $thumbnail = get_post_meta($post->ID, 'Thumbnail', true); if ($thumbnail) { ?> <img src="<?php echo get_post_meta($post->ID, "Thumbnail", true); ?>" alt="<?php the_title(); ?>" title="<?php the_title(); ?>" /> </a> <?php } else { ?> <a href="<?php the_permalink(); ?>" title="" rel="bookmark"> <img src="https://www.SITE/IMAGE.jpg" alt="" title="" /> </a> <?php } ?>
I learned about that here, and it’s marvelous. I have been searching all day, however, on this site and others, for a solution in how to add these thumbnails as image links to the Previous and Next post on a Single post. Inserting php code into the img src breaks everything, and my mind has melted by this point.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Custom field thumbnail in link for Previous Next Posts’ is closed to new replies.