Skip to content

Instantly share code, notes, and snippets.

@laranz
Created March 30, 2022 13:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save laranz/92536a0f36d17ac1292beb00fcca9dd4 to your computer and use it in GitHub Desktop.
Save laranz/92536a0f36d17ac1292beb00fcca9dd4 to your computer and use it in GitHub Desktop.
add_shortcode('post_image_website_link', 'post_image_website_link');
function post_image_website_link($atts) {
$postID = get_the_ID();
$website_link = geodir_get_post_meta( $postID, 'website', true );
$thumbnail = get_the_post_thumbnail( $postID, 'full' );
return '<div class="featured-image">'
. '<a href="' . $website_link . '">'
. $thumbnail
. '</a>'
. '</div>';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment