Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
WordPress 5 Complete

You're reading from   WordPress 5 Complete Build beautiful and feature-rich websites from scratch

Arrow left icon
Product type Paperback
Published in Feb 2019
Publisher Packt
ISBN-13 9781789532012
Length 432 pages
Edition 7th Edition
Languages
Concepts
Arrow right icon
Toc

Table of Contents (18) Chapters Close

Preface 1. Section 1: WordPress FREE CHAPTER
2. Introducing WordPress 3. Getting Started with WordPress 4. Creating Blog Content 5. Pages, Media, and Importing/Exporting Content 6. Section 2: Customizing WordPress
7. Plugins - What They Are and Why You Need Them 8. Securing your WordPress Website 9. Choosing and Installing Themes 10. Customizing your Website Appearance/Design 11. Developing your Own Theme 12. Social Media Integration, Podcasting, and HTTPS 13. Developing Plugins, Widgets, and an Introduction to REST API 14. Section 3: Non-Blog Websites
15. Creating a Non-Blog Website Part One - The Basics 16. Creating a Non-Blog Website Part Two - E-Commerce Websites and Custom Content Elements 17. Other Books You May Enjoy

Creating template files within your theme

You've now got a functional, basic template for your theme. It works great on the main blog page and successfully loads content for anything you can click on within your site. However, we want slightly different templates for other types of content on our site. For example, a single post page needs to have a comment form where visitors can post comments; the page doesn't need to show the date, category, or tags; and the category page should show the category name.

Before we can create other templates, we need to break up the main index.php file into parts so that these different templates can share the common elements. I've mentioned the importance of the header, sidebar, and footer many times. We're going to break them up now. First, let's take a quick look at how it works.

...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at ₹800/month. Cancel anytime