Welcome to this series again, which describes how to create the first word press theme in static HTML. The first part of this series is the static index. Import the HTML file and convert it to a PHP file. Added some template tags and rings. In the second part, the file begins to look like an appropriate topic. Split the file into multiple files and start creating template files for various types of content. Specifically, do the following: Index Split the PHP file into multiple files, creating separate files for the header, sidebar, and footer. Create a file for the ring. Create new template files for static pages, archive pages, and individual posts. Here we go! The
If necessary, you need some tools to mimic the post. Install WordPress development on your local computer whenever possible. Code editor. The code created in part 1 of this series – if there is no code, you can the file I am using. This operation must be performed on the development site, not the live site. I don’t want the world to see your theme until it’s ready. Index First split the PHP file, then split the file created in the first part to create a new file for the header, sidebar, and footer. If you have not already opened the title file to create a theme folder, open it. Create three new empty files and start. The
Header. PHP sidebar. PHP footer. PHP is now index. Open the PHP file. Find all code from the beginning of the file to the navigation menu close. Load the summary 2b693721668dba8bcc578b8de9824642, copy the corresponding code, and create a new header. Paste into the PHP file. Then index Remove from PHP. Instead, it will remind you of what is at the top of each template file, including some comments. Here is the index. PHP. You must add a call to the header file under the load summary 2b693721668dba8bcc578b8de9824642. Index Add it to everything else in the PHP file (except comments):
Load summary 2b693721668dba8bcc578b8de9824642 is now index. PHP and header. Save all PHP files. The create sidebar file is now a sidebar. Index to the sidebar. Find all the code in the PHP file. Load summary 2b693721668dba8bcc578b8de 9824642 empty sidebar. Copy to PHP file and index. Remove from PHP. Note: the next part of this series replaces the static content here with the part area. You need to add currency to the sidebar again. Therefore, at the position where the side barcode is deleted, the following contents are indexed: Add to PHP file. The
Load summary 2b693721668dba8bcc578b8de 9824642 create a footer file and finally create a footer file. Index to the footer. Browse all the code in PHP. The load summary 2b693721668dba8bcc578b8de 9824642 includes not only the footer element, but also the closing and closing body of the main div, HTML tags and wp\u footer hook. The end of the file contains everything. This is the new footer. Copy to PHP file and index. Remove from PHP. Then index Add a call to the footer at the end of PHP. The
The load summary 2b693721668dba8bcc578b8de 9824642 file is now divided into a basic template file (index.php) and three include files. This means that when you add a new template file, you do not have to add all the code for the header, sidebar, and footer every time, so it is a more efficient way to code topics. Just once. Create another code where the ring file appears in multiple files
Create a Korean template file. Index Copy PHP and single. My name is PHP. Loop Copy PHP, loop single. My name is PHP. Create a new single, as shown below. Edit the PHP file. Load the summary 2b693721668dba8bcc578b8de9824642, and then the Lop single. Edit only the title in the PHP file to remove the link. Load summary 2b693721668dba8bcc578b8de 9824642 save all files now. The theme now contains the template file. Topics now have multiple template files and include files, and are configured appropriately. If necessary, you can add template files according to the word press template hierarchy. Now that you have all the loop files you need, you can use them when you add a new template file. For example, category. If a PHP file is added, loop archive. You can call PHP. The next section describes how to add navigation menus and component areas and ensure that function files work properly. How do I use template files in themes? Tell us in the comments! Tags: HTML text printing theme tutorial