External image link linking to same domain
-
I am trying to code so that a form entry is used to create a link for the thumbnail, but the link is linking to within the websites domain:( so if my site is google.com and submit the form to link to gerad.tv it goes to http://www.google.com/gerad.tv, but I just want it to go to gerad.tv) I think something is wrong with this code, but I’m not sure what.
function my_post_image_html( $html, $post_id, $post_image_id ) { $external_link = get_post_meta( get_the_ID(), 'ap_author_url', true ); if ( ! empty($external_link ) && !is_feed() && !is_home() && in_category('user') ) { $html = '<a href="' . $external_link . '" target="_blank">' . $html . '</a>'; }else{ $html = '<a href="' . get_permalink( $post_id ) .'" title="' . esc_attr( get_the_title( $post_id ) ) . '">' . $html . '</a>'; } return $html; }
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘External image link linking to same domain’ is closed to new replies.