When I click on post images it redirects in a page with a url like this: http://localhost/?attachment_id=897. Can I set the default image link like http://localhost/wp-content/uploads/2012/05/dice.jpg instead of http://localhost/?attachment_id=818? Also how to style the attachments page? Should I have a page like attachments.php?


Navigate to: Dashboard -> Settings -> Media

Check this box: Organize my uploads into month- and year-based folders.

Save changes.


Navigate to: Dashboard -> Settings -> Permalinks

Select "Post name" under "Common Settings"

Save changes.

As far as styling an attachment page, you can either open up your page template file, and add a conditional check for is_attachment() or you can make an attachment.php file in your template directory. Read more about the template hierarchy for attachment display.


| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.