- This topic has 6 replies, 3 voices, and was last updated 9 years, 4 months ago by
Tom.
-
AuthorPosts
-
November 28, 2016 at 1:27 pm #248930
Jessica
I deployed my site last night (as you saw) and everything was working OK, but today the header images were all missing and I had to re-add them.
I have to also have an image in the featured image area or it won’t show up in the landing page for the blog. I’m not sure if that’s what’s causing it but I don’t know why less than 12 hours later the header images that I added are no longer showing up.
I did check the use in featured image so that it would show up but it’s not working.
Any idea what I can do to prevent this or if I’m doing something wrong?
Thanks!
November 28, 2016 at 7:56 pm #249073Tom
Lead DeveloperLead DeveloperIt sounds like your images might have still been pointing to your localhost.
Once your localhost wasn’t live (the next day), the URLs no longer worked.
You might need to use a plugin like Velvet Blues Update URLs once you migrate to the live server in order to update all of the URLs.
December 2, 2016 at 4:56 pm #250782mikei
Noticed same issue, I quickly re-added, but surely nobody touched those pages. I will monitor if it repeats.
December 2, 2016 at 5:27 pm #250785Jessica
I discovered that if there is both a featured image AND an image in the header area, then header image gets deleted. At least that’s what it was in my case. My links are all correct and were converted to the live web URL so it was that.
December 2, 2016 at 8:01 pm #250829Tom
Lead DeveloperLead DeveloperOnce something is in the database (a URL, text, setting etc..), it needs to be explicitly deleted by a function (
delete_option(),delete_post_meta()etc..).If you have values full on disappearing from your database, there’s definitely an issue with your install (although I’m pretty sure that’s not possible). One of those functions would need to run at some point.
It’s more likely that the URL changed, or the image was moved/deleted.
December 2, 2016 at 8:09 pm #250832Jessica
I hear that, except neither of those happened. It was fine before I went to bed. First thing in the morning, the header images were not showing. No one could have touched it.
I think it’s a conflict between having both a featured image AND an image set in the page header area. The featured image (which is the exact same image) was there, but the header image was missing. As in, it showed that “missing photo icon” on the page editor. But the photo was definitely there.
It’s fine in posts but doesn’t work to use both on pages.
December 2, 2016 at 8:25 pm #250834Tom
Lead DeveloperLead DeveloperFrom a code perspective, it’s not possible for something to happen without loading the page. Code only runs when something/someone initiates a load on the page.
The featured image and page header image are two different settings in the postmeta database table.
The featured image is stored as an ID, which will carry over when you change servers (from localhost to live server for example). An ID is an ID – nothing changes.
The page header image uses both – it saves the ID of the image and uses it to display the image on the live site.
It also saves the image URL, and uses it to display the preview image.
It sounds like your server migration isn’t updating that URL to the new URL of your server, so the preview image isn’t updating (still pointing to your localhost).
That’s why I like using a plugin like Duplicator, as it replaces all URLs in your database when you migrate servers, even ones in meta boxes.
The plugin Velvet Update URLs does the same which is nice.
-
AuthorPosts
- You must be logged in to reply to this topic.