$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>menus - Homepage is not loading|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

menus - Homepage is not loading

matteradmin10PV0评论

I have developed my wordpress site locally and now it's live on a host. Everything is working fine, but when I click the Home button on the top menu it goes to localhost/wordpress, not to my exact homepage.. Help me fix this.

I have developed my wordpress site locally and now it's live on a host. Everything is working fine, but when I click the Home button on the top menu it goes to localhost/wordpress, not to my exact homepage.. Help me fix this.

Share Improve this question edited Feb 27, 2019 at 17:22 Nathan Johnson 6,5386 gold badges30 silver badges49 bronze badges asked Feb 27, 2019 at 17:13 Chanuka GayanthaChanuka Gayantha 32 bronze badges 3
  • you need to edit your database for references to the old (localhost) site and change them to the live url – rudtek Commented Feb 27, 2019 at 17:21
  • Could you please explain me how to do it.. which data i should change – Chanuka Gayantha Commented Feb 27, 2019 at 17:22
  • Added how I do it as an answer. – rudtek Commented Feb 27, 2019 at 18:42
Add a comment  | 

2 Answers 2

Reset to default 0

You need to go into your new database and change the site url and home url to the new address. I suggest NOT doing this through phpmyadmin or the WP dashboard (using plugins) though as it will cause some problems. Plugins May work, but if wordpress hangs or times out or any number of things you could have a bigger problem.

I recommend is using Search & Replace DB, a free tool by Interconnect, to replace any instances of the host name in the database. It will handle setting the serialized data correctly for you. and it works OUTSIDE of the WordPress system.

First make sure that your wp-config is for the right database.

Go get this tool: https://interconnectit/products/search-and-replace-for-wordpress-databases/

Upload it into your www/ folder. (I usually rename the search and replace folder to SRDB.)

Now navigate to your site with the SRDB at the end on the NEW url. (www.example/SRDB) and the top two lines you'll see a search field and a replace field. (if you get a db connection error here, double check the wp-config to ensure that it has the right credentials).

In the search field, place your old site address.

In the replace field, place your new url.

Hit live run.

ONLY do this after ensuring you're on your new url and that SRDB has loaded into your new database.

Remove the SRDB folder when you are done.

probably is a database migration problem: inside your database table wp_options there are two options, home and siteurl, which in your case must have set as value the "real" homepage in your website.

To complete the migration you should run a search and replace on the whole database, after fixing the options table, to find every url using the old localhost address. Use this plugin to do it.

Articles related to this article

Post a comment

comment list (0)

  1. No comments so far