0
votes
0answers
11 views

Need help with rewrite of Attachment URL [duplicate]

How can I change Attachments URL to example.com/photos/attachment_ID/post_name/attachment_name Thank you
0
votes
0answers
34 views

Changing attachment page Permalink

How can i change the attachment page permalinks to http://domain.com/photos/%attachment_id%/%postname%/%attachmentname% currently my permalinks set to Custom Structure ...
0
votes
0answers
14 views

Change only the attachment permalinks to %post_id%

My permalinks are set to /%category%/%postname%/ but I would like attachments to live at photo/%post_id%/ I already have a rewrite function to change the attachment slug from attachment/ to photo/, ...
0
votes
1answer
75 views

Media/attachment urls don't redirect with fake URL structure

I'm having an issue with media/attachment files and I'm not quite sure how WordPress is returning the URL that it does. I've noticed that I can add anything as a subdirectory structure before a media ...
0
votes
0answers
9 views

Permanent names of attached files required

Simple: How to delete uploaded file ? Secondary: How to replace uploaded file and to keep its filename (inclusive the path) and all links (inclusive on the whole internet!!!) the same?
1
vote
1answer
972 views

Image Attachment Url Rewrite

I'm having an issue with url rewriting for a theme I'm making, which is basically a gallery theme based on the roots theme. Here's how the site navigation works: Home Page (With Tiled Image Gallery) ...
0
votes
3answers
705 views

How do i get post thumbnail using attachment code

Hi i'm using this code below, which links the title of the post to the first attachment in the post. But how do I change it so that it grabs the thumbnail instead? <?php $args = array( ...
0
votes
0answers
169 views

uploading Attachments with permalinks based on parent file structure

We are rebuilding a public-interest site centered on civil rights research & document archives. The links in years of published info posts must be preserved in WordPress, and future uploaded ...
0
votes
1answer
162 views

get_attachment_link() adds a hashtag to URL

I'm using the get_attachment_link() function in a site I'm developing and it's returning a really weird result. For some reason it adds #main at the end of every url. ...
0
votes
2answers
129 views

get_permalink to attachment not working

I have following code <?php $args = array( 'post_type' => 'attachment', 'numberposts' => 12, 'post_status' => null ); $attachments = get_posts( $args ); if ( ...
2
votes
0answers
77 views

Page Attachment Permalink Structure based on Menu Order?

I've been on a quest for the past couple of days reading up on Rewrite in WordPress but still can't seem to figure out how to accomplish this. When using pretty links in WordPress, media attached to ...
0
votes
1answer
64 views

Create a permalink for a post's attachments

I'm trying to create a custom permalink structure. I'd like to have a custom page which displays each post's image attachments, using the following structure: www.mysite.com/hello-world/images If ...
0
votes
1answer
357 views

Help me fix these crazy attachment page URLs (rewrite?)

On one of my sites if a post's permalink is as follows: http://example.com/side-view-of-sheikh-zayed-grand-mosque-in-abu-dhabi-united-arab-emirates/ the attachment page for the thumbnail image ...
1
vote
0answers
71 views

WP_Query Attachment adds additional attachment count and need to link attachment to post url

I just wonder why WP_Query adding one more additional attachment with the defined number or posts. Also need to link attachment (thumbnail) to the post url. Here is my code <?php $query = new ...
0
votes
1answer
134 views

Is there a way to show attachment IDs on the attachment info screen?

I want to use attachment IDs for shortcodes, but if the image is published with a permalink, it's harder to find the ID. I've found some functions online that can turn the attachment url into its ID, ...
0
votes
1answer
103 views

Stop Attachment image names from taking top level permalink

I don't know why but images uploaded to my site in posts are getting a top level permalink. So if I upload an image into a post called "Apple" then it gets an attachment page at mysite.com/apple and ...
0
votes
1answer
517 views

Echo Permalink in Attachment outside of loop?

I have some code showing an image attached to a post, an image in a li list, works fine shows the image as its should. I need the image to link through its main single post though and have tried the ...
1
vote
1answer
346 views

Is it possible to list post attachments in a sub URL endpoint with a dedicated template?

Wordpress provides templates for displaying media attached to a post or page (attachment.php and more). They're also displayed with nice permalinks, such as: ...
0
votes
2answers
1k views

Remove “attachment/” from the URL of attachment pages

Currently, the media for a page on /hello-world/ is shown on /hello-world/attachment/image-name/. Is it possible to remove attachment from this URL, and make it /hello-world/image-name/?
2
votes
2answers
2k views

How to replace “wp-content/blogs.dir” with “media” for attachment permalinks?

How to replace "wp-content/blogs.dir" with "media" for attachment permalinks in a multisite environment? This is how links look now: ...
2
votes
0answers
426 views

Custom attachment permalink structure [closed]

I have 10 images attached to each of a custom post type. My permalink structure for the custom post type is: example.com/post-type/post-title I am using the Wordpress Attachments plugin. My ...
0
votes
1answer
803 views

How do I rewrite attachment urls when permalink structure contains %category%?

I'm trying to change the permalinks to my attachments in the same way as this question, and the given solution works great except for one problem: if the permalinks settings on my site contain ...