wordpress 教程_最好的WordPress教程

wordpress 教程

WordPress is a free and open-source content management system based on PHP and MySQL. Features include a plugin architecture and a template system. It is most associated with blogging, but supports other types of web content including more traditional mailing lists and forums, media galleries, and online stores.

WordPress是基于PHP和MySQL的免费开源内容管理系统。 功能包括插件体系结构和模板系统。 它与博客联系最紧密,但支持其他类型的Web内容,包括更传统的邮件列表和论坛,媒体库和在线商店。

WordPress is powering almost 27% of all websites and currently is dominating the CMS market share. Backed up by a huge community, this Open Source platform powers a multi-billion dollar economy with themes/plugins and custom software.

WordPress为几乎所有网站中的27%提供动力,目前在CMS市场份额中占主导地位。 在庞大的社区的支持下,这个开源平台通过主题/插件和自定义软件为数十亿美元的经济提供了动力。

We recommend you start learning with freeCodeCamp's 4-hour WordPress tutorial on YouTube. This will help you build a WordPress website from scratch.

我们建议您从YouTube上的freeCodeCamp的4小时WordPress教程开始学习。 这将帮助您从头开始构建WordPress网站。

Then, we encourage you to learn PHP - the programming language that powers WordPress. freeCodeCamp has a 4-hour tutorial on PHP and WordPress on YouTube.

然后,我们鼓励您学习PHP-支持WordPress的编程语言。 freeCodeCamp在YouTube 有一个4小时PHP和WordPress教程

什么是PHP? (What is PHP?)

PHP is a server-side scripting language created in 1995 by Rasmus Lerdorf.

PHP是Rasmus Lerdorf于1995年创建的服务器端脚本语言。

PHP is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML.

PHP是一种广泛使用的开源通用脚本语言,特别适合于Web开发,并且可以嵌入HTML中。

首字母缩写PHP代表什么? (What does the acronym PHP stand for?)

Originally PHP stood for ‘Personal Home Page’, as Rasmus Lerdorf created it for use on his own website. Then in 1997 more developers expanded the language and the acronym also changed to what it stands for today: ‘PHP: Hypertext Preprocessor’. As the first ‘P’ in PHP also stands for ‘PHP’, it is known as a ‘recursive acronym’.

PHP最初代表“个人主页”,而Rasmus Lerdorf则将其创建为在自己的网站上使用。 然后在1997年,更多的开发人员扩展了该语言,并且首字母缩写词也更改为今天的含义:“ PHP:超文本预处理器”。 由于PHP中的第一个“ P”也代表“ PHP”,因此被称为“递归首字母缩写”。

PHP的作用是什么? (What is PHP used for?)

As of October 2017, PHP is used on 82% of websites whose server-side language is known. It is typically used on websites to generate web page content dynamically. Use-cases include:

截至2017年10月, 已知服务器端语言的网站中有82%使用PHP。 它通常用于网站上以动态生成网页内容。 用例包括:

  • Websites and web applications (server-side scripting)

    网站和Web应用程序(服务器端脚本)
  • Command line scripting

    命令行脚本
  • Desktop (GUI) applications

    桌面(GUI)应用程序

Typically, it is used in the first form to generate web page content dynamically. For example, if you have a blog website, you might write some PHP scripts to retrieve your blog posts from a database and display them. Other uses for PHP scripts include:

通常,它以第一种形式用于动态生成网页内容。 例如,如果您有一个博客网站,则可以编写一些PHP脚本来从数据库检索博客文章并显示它们。 PHP脚本的其他用途包括:

  • Processing and saving user input from form data

    处理和保存来自表单数据的用户输入
  • Setting and working with website cookies

    设置和使用网站cookie
  • Restricting access to certain pages of your website

    限制访问网站的某些页面

PHP如何工作? (How does PHP work?)

All PHP code is executed on a web server only, not on your local computer. For example, if you complete a form on a website and submit it, or click a link to a web page written in PHP, no actual PHP code runs on your computer.

所有PHP代码仅在Web服务器上执行,而不在本地计算机上执行。 例如,如果您在网站上填写表格并提交,或者单击指向用PHP编写的网页的链接,则计算机上不会运行任何实际PHP代码。

Instead, the form data or request for the web page gets sent to a web server to be processed by the PHP scripts. The web server then sends the processed HTML back to you (which is where ‘Hypertext Preprocessor’ in the name comes from), and your web browser displays the results.

而是将表单数据或网页请求发送到Web服务器,以由PHP脚本处理。 然后,Web服务器将处理后HTML发送回给您(这就是名称中的“超文本预处理器”的来源),然后您的Web浏览器将显示结果。

For this reason, you cannot see the PHP code of a website, only the resulting HTML that the PHP scripts have produced.

因此,您看不到网站PHP代码,只能看到PHP脚本生成的结果HTML。

This is illustrated below:

如下图所示:

PHP is an interpreted language. This means that when you make changes to your source code you can immediately test these changes, without first needing to compile your source code into binary form. Skipping the compilation step makes the development process much faster.

PHP是一种解释性语言。 这意味着,当您对源代码进行更改时,您可以立即测试这些更改,而无需首先将源代码编译为二进制形式。 跳过编译步骤可使开发过程更快。

PHP code is enclosed between the <?php and ?> tags and can then be embedded into HTML.

PHP代码包含在<?php?>标记之间,然后可以嵌入到HTML中。

安装 (Installation)

PHP can be installed with or without a web server.

PHP可以安装Web服务器,也可以不安装Web服务器。

GNU / Linux (GNU/Linux)

On Debian based GNU/Linux distros, you can install by:

在基于Debian的GNU / Linux发行版上,可以通过以下方式安装:

sudo apt install php

After installing you can run any PHP files by simply doing this in your terminal:

安装后,只需在终端中执行以下操作即可运行任何PHP文件:

php file.php

You can also install a localhost server to run PHP websites. For installing Apache Web Server:

您也可以安装本地主机服务器来运行PHP网站。 要安装Apache Web Server:

sudo apt install apache2 libapache2-mod-php

PHP可以做什么? (What Can PHP Do?)

  • PHP can generate dynamic page content

    PHP可以生成动态页面内容
  • PHP can create, open, read, write, delete, and close files on the server

    PHP可以在服务器上创建,打开,读取,写入,删除和关闭文件
  • PHP can collect form data

    PHP可以收集表单数据
  • PHP can send and receive cookies

    PHP可以发送和接收Cookie
  • PHP can add, delete, modify data in your database

    PHP可以添加,删除,修改数据库中的数据
  • PHP can be used to control user-access

    PHP可用于控制用户访问
  • PHP can encrypt data

    PHP可以加密数据

为什么要使用PHP? (Why PHP?)

  • PHP runs on various platforms (Windows, Linux, Unix, Mac OS X, etc.)

    PHP可在各种平台(Windows,Linux,Unix,Mac OS X等)上运行
  • PHP is compatible with almost all servers used today (Apache, IIS, etc.)

    PHP与当今使用的几乎所有服务器(Apache,IIS等)兼容。
  • PHP supports a wide range of databases

    PHP支持广泛的数据库
  • PHP is free. Download it from the official PHP resource: secure.php.net

    PHP是免费的。 从官方PHP资源下载它: secure.php.net

  • PHP is easy to learn and runs efficiently on the server side

    PHP易于学习并且可以在服务器端高效运行

PHP框架 (PHP Frameworks)

Since writing the whole code for a website is not really practical/feasible for most projects, most developers tend to use frameworks for the web development. The advantage of using a framework is that

由于对于大多数项目而言,为网站编写整个代码并不实际/可行,因此大多数开发人员倾向于使用框架进行Web开发。 使用框架的优点是

  • You don’t have to reinvent the wheel every time you create a project; a lot of the nuances are already taken care of for you

    您不必在每次创建项目时都重新发明轮子。 许多细微差别已经为您解决
  • They are usually well-structured so that it helps in the separation of concerns

    它们通常结构合理,因此有助于分离关注点
  • Most frameworks tend the follow the best practices of the language

    大多数框架倾向于遵循语言的最佳实践
  • A lot of them follow the MVC (Model-View-Controller) pattern so that it separates the presentation layer from logic

    他们中的许多人遵循MVC(模型-视图-控制器)模式,从而将表示层与逻辑分离

文献资料 (Documentation)

PHP is well documented. The official docs include examples on almost every function reference guide, as well as user comments.

PHP有据可查官方文档包括几乎所有功能参考指南中的示例以及用户注释。

其他资源 (Other Resources)

  • Tizag.com PHP Tutorial: still-relevant tutorials for getting started with PHP

    Tizag.com PHP教程 :与PHP入门相关的教程

  • Awesome PHP: a curated list of PHP libraries, resources, and “shiny things”

    很棒PHP :精选PHP库,资源和“闪亮的东西”列表

  • Laracasts.com: a membership website to learn web application development with PHP

    Laracasts.com :一个会员网站,用于学习使用PHP开发Web应用程序

翻译自: https://www.freecodecamp.org/news/best-wordpress-tutorial/

wordpress 教程

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值