Skip Navigation

[Resolved] Image URL missing www. in front end display

This thread is resolved. Here is a description of the problem and solution.

Problem:
Custom image fields are being output on the front-end but are missing the www part of the URL.

Solution:
The client had uploaded images on a server where the URL did not use www, then changed the server settings to use www, so the image URLs in wp_posts were missing the www. A plugin to search and replace urls could solve the problem.

This support ticket is created 6 years, 5 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 10 replies, has 2 voices.

Last updated by chrisB-30 6 years, 5 months ago.

Assisted by: Nigel.

Author
Posts
#912801

Hello,

I created a custom field called "ico"

It is an image that displays in my galleries like this one: hidden link

Here is how It is set up in my views backend:
[types field='ico'][/types]

The problem is on the front end display, the image url is missing the www. as you can see in this screenshot:

hidden link

This is causing insecure content warnings and breaking my https

Any idea what is causing this?

Thanks

#912835

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Chris

Can you try something?

Go to Toolset > Settings > Custom Content and clearing the cache of images, then checking the two checkboxes for resizing image options.

Does that make any difference? (It did for another client reporting a different but possibly-related issue.)

#913062

Unfortunately that did not solve the problem.

Strangely, my entries are fine and they use the same basic idea but the image field is called "logo"

Here is an entry:
hidden link

The difference is that the ico (the one that doesn't include the www.) is served from a view and the "logo (the one that does include the www.) is served from a content template.

Here is a snippet of the code from the content template:

-------------------
<div class="logo-img">
[wpv-conditional if="( has_term('amolatina', 'agency', null) eq '1' )" ]
hidden link field='id' output='raw'][/types]%26afid%3D20103%26subafid%3D{affiliate_id}%26transaction-id%3D{transaction_id}%26offer-id%3D{offer_id}" target="_blank" rel="noindex noopener">
[types field='logo' alt='%%ALT%%' title='%%TITLE%%' width='300' align='center' resize='proportional'][/types]<img class="aligncenter" style="padding:2px" src="hidden link" />

[/wpv-conditional]
[wpv-conditional if="( has_term('anastasiadate', 'agency', null) eq '1' )" ]
hidden link field='id' output='raw'][/types]%26afid%3D20068%26subafid%3D{affiliate_id}%26transaction-id%3D{transaction_id}%26offer-id%3D{offer_id}%26RMC%3D{aff_sub}%26utm_source%3DHasOffers%26utm_medium%3DCPA%26utm_campaign%3DFirstOrder" target="_blank" rel="noindex noopener">
[types field='logo' alt='%%ALT%%' title='%%TITLE%%' width='300' align='center' resize='proportional'][/types]<img class="aligncenter" style="padding:2px" src="hidden link" />

[/wpv-conditional]

----------------------

So, it appears as if the problem is with views.

Any other ideas?

#913328

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Chris

We have a few reports of problems with image fields since the update, but not this exact one.

Sites running https seems to be a common thread.

Do you only have the production site or do you have another install, e.g. locally, for development that you could test whether this still occurs without https?

If you can't test that yourself I'll need a copy of your site so that we can (hidden link).

Let me mark your next reply as private in case you need to share site details with me.

#913393

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Screen Shot 2018-06-14 at 11.45.13.png
Screen Shot 2018-06-14 at 11.42.50.png

Hi Chris

I was trying to track down why they should be outputting without the www taking for granted that they were added with it.

But when I look at an individual bride post, the images that were added don't include the www, so, no, they won't output it.

In the first screenshot you can see how it looks currently, and in the second you can see what happened when I added the image again, selecting it from the media library. The url correctly includes the www.

I don't know how you added the images in the first place, but that is the problem.

#913781

Ah, Man! That would do it.

I will have to figure out how to do a global replace of all those.

Thanks alot... Again!

#913792

Actually now that I look at it, that still does not solve the problem.

You were looking at the staging site - which actually was non www until I had this issue. Then I converted to www to see if I could figure out what was wrong.

So, you are correct, on the staging site the images were all loaded on the non www version of the site and therefore are all non www in the media browser.

But if you look at the live site - you will see that the urls in the individual bride entries do in fact contain the hidden link.

Here is a screenshot:
hidden link

You can also see in the live site media browser that they are listed as hidden link.

Here are some screenshots of the media browser:
hidden link
hidden link

But still - the www. is not showing in the front end:
hidden link

Sorry about the confusion - this is the first time I used a staging site!

Let me know if you want to look at the live site - I couldn't figure out how to make this reply private so I didnt want to send login info.

#913887

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Yes, please, let me have credentials for the live site which actually has the issue.

I may take a copy for testing to share with the devs once I've verified what is happening.

I've set up a private reply.

#915316

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Chris

I haven't forgotten you, but have been really busy, I'll get back to this in the morning.

Sorry for the delay.

#916509

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Chris

I spent some time looking at what's actually stored in the database, and I found that the images uploaded to the media library are stored in wp_posts without the www.

When I created a new test bride post and uploaded images they were correctly saved using the www. At some point you must have been using the site without the www, when the bulk of your content was uploaded, and then switched to using www as you are now, without updating the media URLs.

I suggest you try using a plugin such as https://wordpress.org/plugins/velvet-blues-update-urls/ to change the URLs that don't have www to include www, which should then see the images output with the www.

#916590

Yep that did it - site is secure once more...

Man, that's the last time I use a staging site!

Thanks again.