I have an issue that I believe can be solved one of two ways.
I am using Featured Images in posts for content on a home page slider. What I would like to have happen is to have the destination links on click to be custom. Not the post or image URL of the post/featured image being used to feed the slider.
1) I thought I might be able to use the Image URL feature on the image itself, but it turns out the Featured Images will not accept a custom URL. It defaults back to the image path.
2) I have tried using a custom Post Meta field, but my attempts to retrieve that meta have been unsuccessful. I have set a Meta Field with the name "slider-url" and have dropped the path to the desired destination page into the field. I am then using the following code in the loop for the slider (from the WP Codex) in an attempt to pull that value into the href=""
<?php echo get_post_meta($post->ID, "slider-url", true); ?>
I am hoping someone might either have a hack for the Featured Image "Image URL" (along with a way to retrieve that URL), or alternately some insight into why my custom post meta might not be working.
Thanks in advance for your time and expertise.
EDIT: Here's the specific block of code. It's contained within the PHP file of the slider plugin.
<div id="slider"> <?php $category = get_option('wpns_category'); $n_slices = get_option('wpns_slices'); ?> <?php query_posts( 'cat='.$category.'&posts_per_page=$n_slices' ); if( have_posts() ) : while( have_posts() ) : the_post(); ?> <?php if(has_post_thumbnail()) : ?> <a href="<?php echo get_post_meta($post->ID, "slider-url", true); ?>" title="<?php the_title(); ?>"> <?php the_post_thumbnail(); ?> </a> <?php endif ?> <?php endwhile; endif;?> <?php wp_reset_query();?> </div>
Additionally, here's a screen capture of the post meta field: http://s.sct.io/Bl6O