Skip to content

Instantly share code, notes, and snippets.

@tjhole
Created September 22, 2014 19:19
Show Gist options
  • Save tjhole/59c987802b8e02297997 to your computer and use it in GitHub Desktop.
Save tjhole/59c987802b8e02297997 to your computer and use it in GitHub Desktop.
WORDPRESS : Remove parent from attachment URL
function wpa60888_attachment_link( $link, $id ){
return home_url() . '/?attachment_id=' . $id;
}
add_filter( 'attachment_link', 'wpa60888_attachment_link', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment