如何将WordPress网站移动到我的计算机上进行开发?

如何将WordPress网站移动到我的计算机上进行开发?

问题描述:

I was just hired to work in web design with WordPress and I'm struggling because I'm not experienced with the platform. My job is, basically, take the design made in Adobe Illustrator and build the layout in HTML and CSS.

Today I was assigned a site that's already online and had to build the new layout. My instructions were to activate the new template in the WordPress wp-admin, to create the new files (index.php, header.php, footer.php and style.css) in the FTP server and build from there.

Everything OK with that except that when I'm working on the site (maybe 3 or 4 hours), the site is kinda down because I'm uploading the new (incomplete) layout, am I explaining correctly?. E.g., if the web address is theclientsite.com I go to theclientsite.com/wp-admin/themes, define and activate new theme, write the code and test it directly in the browser going to theclientsite.com.

The question is: is there a way to work locally with the WordPress installation? I mean a way to test the site in something like localhost/theclientsite in the browser. My intuition says that the answer is YES, because we're talking about php code. But, as I said, I'm not experienced in the WordPress platform. I don't know if I need to be connected to a WordPress's server or something like that, or if I need to install something in my machine.

Any help, guide or tutorial is welcomed and will be appreciated. Thanks in advance for your answers.

我刚被聘请使用WordPress从事网页设计工作,我很挣扎,因为我没有经历过 平台。 我的工作基本上是采用 Adob​​e Illustrator strong>中的设计,并在HTML和CSS中构建布局。 p>

今天我被分配了一个已经在线的网站 不得不建立新的布局。 我的指示是在WordPress wp-admin code>中激活新模板,以创建新文件( index.php code>, header.php code>, FTP服务器中的 footer.php code>和 style.css code>)并从那里构建。 p>

一切都还可以,除非当我 我正在网站上工作(可能是3或4个小时),网站有点下来,因为我正在上传新的(不完整的)布局,我是否正确解释? 例如,如果网址是 theclientsite.com code>,我会转到 theclientsite.com/wp-admin/themes code>,定义并激活新主题,编写代码并直接测试 在浏览器中转到 theclientsite.com code>。 p>

问题是:有没有办法在本地使用WordPress安装? 我的意思是一种在浏览器中以类似 localhost / theclientsite code>的方式测试网站的方法。 我的直觉说答案是肯定的,因为我们正在谈论PHP代码。 但是,正如我所说,我在WordPress平台上没有经验。 我不知道是否需要连接到WordPress的服务器或类似的东西,或者我需要在我的机器上安装一些东西。 p>

欢迎任何帮助,指南或教程 并将不胜感激。 提前感谢您的回答。 p> div>

Yes, it is possible to work offline by installing locally:

  • Apache / Nginx
  • PHP
  • MySQL

That can be done...:

You will have to edit your host file to map the domain.com to your localhost (127.0.0.1). The reason is that, by default, WordPress is not domain agnostic, which means absolute links (including the domain) are stored in the database. Otherwise, you will need to edit the data to map it to localhost.

As you are new with WordPress, I will remind you to backup the website BEFORE doing any change. A free tool like BackWPup can do the job to backup all files and the database.

The changes you made on the website were made directly in production (meaning on the live site). That is a really bad practice, as you probably know why now, because your visitors see and incomplete and buggy website.

That is why you need a dev environment where you can build and test everything. If you did not do any backup and feel screwed, you can install a maintenance plugin like Ultimate Coming Soon Page and configure it to tell your visitors that the site is having a make over and come back later.

As for tutorials, I would start with How to install WordPress with WampServer. First, you will understand how to install WordPress... in general. Once you understand this part, you are ready to export an existing website and import it locally. I would suggest to read more about How move a WordPress website locally.

This is a start! Use Google as you go... it will help a lot! :-)

You can install XAMPP packages that ships with Apache, Mysql (MariaDB actually) and PHP environments. All already configured so you can just Next > Next > Install.

https://www.apachefriends.org/pt_br/index.html

I've always preferred working directly on the remote server using Aptana with built-in FTP client. I've known others that prefer working locally using WAMP. https://sourceforge.net/projects/wampserver/