Can't get attachment page link
-
Hi, I am trying to get the attachment page using any of the wordpress functions below and the id. Unfortunately they all return the link to the image file instead of the attachment page. How does Eazyest create the attachment pages, is it the same as wordpress or does one need to search a different table?
For more details on what I am trying to achieve see https://philipnewcomer.net/2012/11/get-the-attachment-id-from-an-image-url-in-wordpress/#comment-5385
wp_get_attachment_link( $attachment_page_id, '', true, '', 'wp attachment link true' );
wp_get_attachment_link( $attachment_page_id, '', false, '', 'wp attachment link false');
the_attachment_link( $attachment_page_id, false, false, true);
All the above functions return the same link, which is the link to the image file. E.g. https://127.0.0.1/hiresimages/windsurfing/_cache/baja-Mexico-8831-1024×637.jpg
If I use
it will display the full size image in the original eazyest upload directory, e.g. https://127.0.0.1/hiresimages/windsurfing/baja-Mexico-8831.jpg though the URL it links to is still https://127.0.0.1/hiresimages/windsurfing/_cache/baja-Mexico-8831-1024×637.jpg
wp_get_attachment_link( $attachment_page_id, 'full', true, '', 'wp attachment link true' );Any help appreciated.
- The topic ‘Can't get attachment page link’ is closed to new replies.