Support » Plugins and Hacks » Featured Image External Link

Viewing 6 replies - 1 through 6 (of 6 total)
  • please re-post your code – this time marking it according to forum guidelines http://codex.wordpress.org/Forum_Welcome#Posting_Code – to keep it from getting mangled by the forum’s parser.

    <div class="imageframe-1">
    <?php $key="featured_external"; $single=1; $custom = get_post_meta($post->ID, $key, $single); ?>  
    
    if($custom == ""){
    	<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"> <?php the_post_thumbnail(); ?></a> ;}
    else{
    	<a href="<?php echo $custom; ?>" title="<?php the_title(); ?>"> <?php the_post_thumbnail(); ?></a> ;}
    
                				</div>

    Sorry – forgot to post the backticks!@ D’oh!!!!!

    there were some php tags missing in the code:

    <div class="imageframe-1">
    <?php $key="featured_external"; $single=1; $custom = get_post_meta($post->ID, $key, $single); ?>  
    
    <?php if($custom == ""){ ?>
    	<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"> <?php the_post_thumbnail(); ?></a> <?php ;}
    else{ ?>
    	<a href="<?php echo $custom; ?>" title="<?php the_title(); ?>"> <?php the_post_thumbnail(); ?></a> <?php } ?>

    Thanks SWEEPER! That did the trick. Mental note to self, don’t write PHP at night when your kids are on your lap! Thanks again!

    how do you set the external link per featured image?
    where exactly is this code placed?
    thanks

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Featured Image External Link’ is closed to new replies.