PHP

PHP is another kind of code (along with HTML) that is used in WordPress. The difference between HTML and PHP is that HTML tells a web browser how to display the content, but it does not change the content. PHP runs a script, that is, it gives the browser commands to actually create new content each time a PHP page is loaded.

The best example of this is the built-in WordPress blog page. When you create blog posts, you do it by going to Posts/Add New. But have you noticed that you never have to directly edit your Blog page? This is because each time someone clicks on the blog page URL, a PHP script is activated that says “look for all posts, and display them in date order.” Without the PHP script, you would have to manually add each new post to the top of your blog page.

In self-hosted WordPress you can see what PHP code looks like by going to Appearance/Editor, and click on 404.php, or another filename ending in PHP in the right hand column. This screen is not the same as the Editor for pages and posts – these are the actual files that make your website a website, so DO NOT CHANGE ANYTHING (as long as you steer clear of the Update File button, you will be fine). When you are done looking at the php file, just click another area of your dashboard (such as Dashboard/Home) to leave the Editor window.

« Back to Glossary Index

Comment