admin管理员组文章数量:1122832
I have a problem with images.
I can see my uploaded images, as previously, through the media library. I can access each image by clicking on "edit". But if I then click on "View Attachment Page", I am taken to the "404! We couldn't find the page!" message. This applies to all images in the library.
At the same, images in some posts (but not all) are behaving differently from before. It used to be possible for readers to click them and see them full size, whereas now that click simply relads the posts in question.
I have experimented with deactivating plugins, but have not found a solution for this. Does anyone know what might cause this, and what might have triggered it?
I have a problem with images.
I can see my uploaded images, as previously, through the media library. I can access each image by clicking on "edit". But if I then click on "View Attachment Page", I am taken to the "404! We couldn't find the page!" message. This applies to all images in the library.
At the same, images in some posts (but not all) are behaving differently from before. It used to be possible for readers to click them and see them full size, whereas now that click simply relads the posts in question.
I have experimented with deactivating plugins, but have not found a solution for this. Does anyone know what might cause this, and what might have triggered it?
Share Improve this question asked Jan 30, 2013 at 16:18 H HallH Hall 211 silver badge2 bronze badges 3- Can we see a live link to the issue? – Chip Bennett Commented Jan 30, 2013 at 16:27
- 3 What changes have you made to your install between when things were working and when they stopped working? – Dan Commented Jan 30, 2013 at 16:33
- I have experienced problems similar to this when file/folder permission change on the server. Why would file permissions change? In my experience, it was a malware attack. A FANTASTIC free plugin - WordFence - is a quick 'sanity check'. It will detect and help clean if there is a problem. If WordFence scans clean check your file/folder permissions. Here is a recent blog post on the topic: wpbeginner.com/beginners-guide/… – AntEater Commented May 17, 2017 at 13:03
3 Answers
Reset to default 0From what you've described, it sounds like the theme doesn't have an attachment.php template to handling displaying the actual attachment page.
You check on the attachment page, by going to Appearance->Editor, and checking for an attachment.php; however, I believe that answer is incorrect. WordPress should default to displaying the image on the normal blog index page, if I'm not mistaken. Which means the error could have something to do with a custom permalink structure.
Have you changed the permalink structure? If so, try changing it back to default and see if you still get a 404.
It could still be your permalink settings, going to the Settings -> Permalink page and Saving will actually flush the rewrite rules and may just fix the problem. You can also try changing to the default structure and back again if this doesn't work, as I think this rewrites your .htaccess file.
After that you may want to check your .htaccess and make sure it is not corrupted, security and caching plugins can sometimes do this, but this sounds unlikely if everything else is still working fine. Beyond that you still may have your theme or plugin may be interfering somehow.
Your theme will require either a catch all 'attachment.php' template or specific template for the attachment type, ie 'image.php'
here's a very simple one:
image.php
<?php
get_header();
while ( have_posts() ) : the_post();
the_title( '<h1 class="entry-title">', '</h1>' );
the_content();
endwhile;
get_footer();
?>
本文标签: Why can I not view image attachment pages
版权声明:本文标题:Why can I not view image attachment pages? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736282758a1926746.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论