tamara.vining
Member
Posted 3 months ago #
I'm having a problem with WordPress PHP code adding the title to the URL of images in comments and replies to comments in a page, which breaks the links to the images, so they can't appear on the page. Do you know where I would fix this? I'm using a modified twentyten theme.
Thanks,
tamara.vining
kmessinger
Member
Posted 3 months ago #
tamara.vining
Member
Posted 3 months ago #
This page looks fine, with all the images:
http://blog.trupanion.com/october-2010-trupanion-giveaways/
but as soon as you get into the comment pages:
http://blog.trupanion.com/october-2010-trupanion-giveaways/comment-page-1/
the first two images are fine, including the first use of the gold-star.jpg:
http://blog.trupanionpetinsurance.com/wp-content/uploads/2010/09/gold-star.jpg
but the rest of the of them look like the title of the page has been added to the pathway of the image link, breaking them as an image link, i.e., the second use of the gold-star.jpg now has a pathway of:
http://blog.trupanion.com/october-2010-trupanion-giveaways/wp-content/uploads/2010/09/gold-star.jpg
which breaks the link and the image on the page.
I've looked through the php of the comments, as well as functions, and loop pages, but don't see why this is happening.
kmessinger
Member
Posted 3 months ago #
I see the gold star fine in FF with this link,
http://blog.trupanionpetinsurance.com/wp-content/uploads/2010/09/gold-star.jpg
I see no broken images.
[Edit] Now I see the broken ones.
tamara.vining
Member
Posted 3 months ago #
The first two images load fine, but all the images below that are broken. This isn't the only comment page where this has happened, that's why I'd like to find it in the code.
http://blog.trupanion.com/october-2010-trupanion-giveaways/comment-page-1/
kmessinger
Member
Posted 3 months ago #
In FF there is no signs of bad images. They are just missing.
In IE, you get the box with the red X. I was in FF the first time and saw no problems.
You might want to check the mark-up, http://validator.w3.org/check?verbose=1&uri=http%3a%2f%2fblog.trupanion.com%2foctober-2010-trupanion-giveaways%2fcomment-page-1%2f
tamara.vining
Member
Posted 3 months ago #
The images aren't missing. They show up on the top level page.
I found these missing links using a link validator. The images are in the WP content folder, but they don't load on comments, or replies to comments, because WP is adding the title of the page to the path of the image. The original image is there, it just can't be found at the address it looks for because WP has changed the location by adding something to the URL.
I want to take out the code that adds the title of post page to the image address.
kmessinger
Member
Posted 3 months ago #
You should use an absolute url not a relative. Since the pages are created dynamically they need absolute urls.
tamara.vining
Member
Posted 3 months ago #
Do you know where in the code WP is adding the title to the image?
It's not how I'm adding the images - they are showing up in the content folder fine. It's how and why WP changes the pathway to the image by adding in the title, which I didn't put there in the first place. WP adding things into the URL is breaking hundreds of links on my site.
kmessinger
Member
Posted 3 months ago #
First (and I should have said this earlier), have you tried:
- deactivating all plugins to see if this resolves the problem. If this works, re-activate the plugins one by one until you find the problematic plugin(s).
- switching to the Twenty Eleven theme to rule out any theme-specific problems.
- resetting the plugins folder by FTP or PhpMyAdmin. Sometimes, an apparently inactive plugin can still cause problems.
- re-uploading the wp-admin and wp-includes folders from a fresh download of WordPress.