Support » Plugins » Hacks » Rewrite Attachments Page URL

  • Hi,
    how can i change Attachment Pages URL to something like this
    currently I added on functions.php file the following code

    function wpd_attachment_link( $link, $post_id ){
        $post = get_post( $post_id );
        return home_url( '/photos/' . $post->ID . $post->post_name );
    add_filter( 'attachment_link', 'wpd_attachment_link', 20, 2 );

    but it is showing me as
    thank you

  • The topic ‘Rewrite Attachments Page URL’ is closed to new replies.