• Resolved MarkMushakian

    (@markmushakian)


    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)
  • Thread Starter MarkMushakian

    (@markmushakian)

    What I really need, because I’d like to use this for a blog archive page, too, is to be able to access the individual entry’s permalink structure, and also to be able to place that within the linked image.

    Thread Starter MarkMushakian

    (@markmushakian)

    I have gone with the post_thumbnail method, and am no longer looking to use the image for a previous/next link, so I’m closing this.

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.