Saving a blog with php Functions in aTheme

So I ran into this awesome situation. After I have moved and got my server up here with me, I am faced with a temporary ordeal. I have no control over the router and how information is relayed to my server. Nor do I have control over the IP addy in which I am given. It isn’t my networking equipment. So I was forced to change the address, and until I can get any sort of port forwarding or DMZ set up, I’m without access to my domain from my server. So as of the writing of this post I’ve had to figure out a way to update wordpress’ url and home link settings without being able to login to the admin pages.

Anytime you try to go to the site I am forced to be redirected to the domain, however at the time of this writing that ends up hitting the router that I’m behind, which doesn’t point to this server obviously, therefore I’m thrown a 404 error. The only way to allievate this situation is to change the URL’s to point to the local IP. At least that is the only thing I can think of as of right now.

How can you do that if you can’t even get to the admin pages? It’s almost too easy.

Inserting some php functions in the active theme is all it takes.? Here are those functions.

update_option('siteurl','http://example.com/blog');
update_option('home','http://example.com/blog');

These functions needs to be placed directly after the <?php line in the functions.php file of the active theme.

You can discover how I did this from this post here. There are other methods available. That post tells you how to do it.

John T Skarbek

John T Skarbek
Im an Infrastructure Engineer at CA Technologies in the Agile Business Unit. Reading and using the latest and greatest of technology is what I want to be doing. Blogging is not something I do on any regular basis (and it shows).

Demonstrating Memory Behavior for AWS Lambda Function Freezing

AWS indicates that when a function is executed, there are some things that getleftover between runs. The execution environment, which AW...… Continue reading

Openshift v3 Deployment Strategy

Published on April 23, 2016

Haproxy URL Rewrite Logging Double Take

Published on May 29, 2015