Setting External URL For a list of Featured Images
-
Hi there – I have been looking at related forums, coming very close to solving my issue but can not get it to work in my context.
I am relatively new to creating custom posts, page templates, and custom fields. Have read up on custom fields and understand them but my PHP knowledge isn’t super strong.
I’ve created a page that calls featured images from a custom post type in their own divs. How can make sure these images link to external sites (it’s a list of corporate partners.
Here’s what I have so far, thanks!
<?php
$args = array( ‘post_type’ => ‘partner’, ‘posts_per_page’ => 15, ‘order’ => ‘ASC’ );
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
echo ‘<div class=”corporate-logo”>’;
the_post_thumbnail(‘medium’);
get_post_meta($post->ID, ‘imglink’, true);
$url = get_post_custom_values(‘URL-for-featured-image’);
echo ‘</div>’;endwhile;
?>
https://lifebeat.org/about/partners/corporate-partners/
Thanks in advance!
- The topic ‘Setting External URL For a list of Featured Images’ is closed to new replies.