PHP for WordPress
Learn the basics of PHP used in WordPress.
WordPress and PHP
WordPress uses MySQL as its main database to store all the data of a website. This includes the content of the posts and pages and metadata like the user profile information and plugin settings, etc. Other databases can be used but MySQL has been found to be the most compatible with WordPress. WordPress uses PHP to interact with the underlying database and fetch data. This course delves into PHP specific to WordPress only, to show how to leverage the power of PHP to fully automate a website. PHP is used to get specific information from the database and plug it in the HTML template file to create a web page.
By using PHP with an underlying database, WordPress makes it easy to create a large number of web pages. A WordPress website has a web page for all static pages, all blog posts, and all archives. Previously, each page of the website had to be coded separately in HTML. Now, instead of hardcoding all the pages in the website, we use template files that power different types of pages on a website and then use PHP tags to fetch the appropriate content for a particular page.
PHP is a server side scripting language, meaning that it runs on the server where the website is hosted. When someone tries to visit a page on a website, the request is sent to the web hosting server which runs the PHP code that creates an HTML page. This HTML page which is the output of the PHP code is then sent to the client. This is the reason PHP is not shown on the client side when ...