404 error on displaying single image
-
Since a client of mine updated both WP and NGG to the latest versions, the display of a single image in her galleries doesn’t work anymore, and I can’t figure out why.
Here is the website in question: https://www.lydianederlof.nl/
If you click on a thumbnail image in the carousel you get a 404 page, while you should get that image as a single image filled on the page. If you click on “Werk” you get the gallery overview with bigger images. That still works fine. However also there if you click on one of these images you should end up at the same single image picture page.
The carousel at the top is a gallery template I created myself. The gallery on the page “Werk” is the standard gallery inserted with
[nggallery id=X]
shortcode.My htaccess file looks like this:
# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress
This is how the gallery code looks like (the relevant gallery printing part):
<div id="painting-thumbs"> <?php if (!empty ($gallery)): ?> <?php $i = 1; ?> <?php foreach($images as $image): $style = ''; if($i == 1) $style = "first"; if($i == count($images)) $style = "last"; if($image->hidden) continue; ?> <div class="thumb <?=$style?>" id="image-<?=$image->pid ?>"><a href="<?=home_url()?>/nggallery/page-9/image/<?=$image->pid?>" title="Bekijk '<?=$image->alttext?>' in het groot" alt="Bekijk '<?=$image->alttext?>' in het groot"><img title="<?=$image->alttext?>" src="<?=$image->thumbnailURL?>" <?=$image->size?> /></a></div> <?php $i++; ?> <?php endforeach; ?> <?php else: ?> Deze gallerij is nog leeg! <?php endif; ?> </div>
I know the link to the single images is hardcoded and not the nicest solution. The gallery slug name is correct (nggallery), the page ID (9) is correct, this is the page ID for “Werk”.
Things I’ve tried already but were unsuccessful:
- Regenerated WP permalinks several times, also in NGG under Options “Activate permalinks” disabled / enabled and saved a couple of times
- Created a whole new gallery with different images and a different page, still get 404’s on single images
- Hit “Create new URL friendly image slugs” button
What am I doing wrong?
- The topic ‘404 error on displaying single image’ is closed to new replies.