Just building a theme but I am stuck with attachment images.

When I add images from the library to posts (or pages) and link them to the "attachment page" I get a 404 error. The link is like "http://localhost:8888/mywebsite/name-of-image".

When I add images directly to posts (upload in post, not taking one I added to library before) it works. The link is like "http://localhost:8888/mywebsite/name-of-post/name-of-image".

I tested with "twentysixteen" theme - same problem. What am I doing wrong here?

Permalinks are okay I think (refreshed it some time).


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.