View Single Post
Old 04-13-2020, 06:30 AM  
seoguy
Confirmed User
 
Join Date: Nov 2004
Posts: 381
solved...

for anybody who runs into such a (similar) problem, this works:

$externalurl = get_post_meta( get_the_ID(), 'ExternalUrl', true);
if( ! empty( $externalurl) ) {
$externalurl = get_post_meta($post->ID, 'ExternalUrl', true);
$output .= '<a href="' . get_post_meta( get_the_ID(), 'ExternalUrl', true) . '" class="entry-featured-image-url" target="_blank">';
} else{
$output .= '<a href="' . esc_url( get_the_permalink( $post_id ) ) . '" class="entry-featured-image-url">';
}
seoguy is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote