wordpress-logo-notext-rgbI was setting up a temporary WordPress site for a client as a placeholder for their business. All they wanted was their logo, a link to an existing product page, and a message about the site being under construction.

Since they were going to have some design ready shortly, I set them up with a WordPress site, and found a simple theme (Decode by Scott Smith) that their logo would work with.

The owner then told me she wanted to see the site running with SSL (aka HTTPS), so I grabbed a certificate and installed it.

To my surprise I saw the little warning on the site that told me it wasn’t fully secure.

Screen Shot 2014-01-01 at 9.47.57 AM

So I dug into the page and found that the header image was being returned with the full URL of the site (not using a relative URL, so it contained the “http://” at the front of the image’s source element).

It occurred to me that I might have to upload the file using SSL (HTTPS), but that might lead to other issues. What I really needed to do was to get the image URL to be relative.

So digging around a bit, I found that the theme’s options are stored in the WordPress table called wp_options, in a row for that particular theme.

A query on the database of:

Returns all of the options for the various themes that have stored options in the past. Looking for the particular theme, I knew I needed to change an option called “header_image”. Pulling the value for that column out, it was clearly structured data (a bit like JSON), so it seemed like maybe I’d get lucky and just be able to modify that URL and remove the “http:” from it:

So of course I tried that and the theme (along with most of the settings) no longer worked. Digging a bit more, I found some threads that talked about the theme options structured data, and how they were constructed as a type:length:value set, so I updated the field again, this time changing the length to be five characters shorter:

And not only did the theme look right again, but I got the green light on my SSL:

Screen Shot 2014-01-01 at 10.14.03 AM

The down side to this is I have to remember to change these settings any time I update the header image, but in this case since it’s the logo it’s not likely to change.

According to the theme’s author (Scott Smith), this is an artifact of the WordPress Core API.

Enhanced by Zemanta