![]() ![]() Go ahead and now create a new file in your theme folder named page.php. If the page.php file is present, WordPress will use the code in that file instead of index.php to render the page. The page.php file comes into play when you want to customize the look and layout of pages on your WordPress site. If this file is not present, your pages will simply use the index.php file to render output to the browser. It turns out, the page.php file is not mandatory to create a basic theme. We are clearly able to visit a couple of example pages on our site, but there is not yet a page.php file. Our current theme does not yet have a page.php file, yet we can still view the example pages in our browser. Pages are often used for content such as an “About Us” page, or a “Contact Us” page. When you publish a page, it does not appear at the top of your site as the first entry like a normal blog post would. What sets them apart is that a page in WordPress is a way to publish content that is not part of the normal blog stream so to speak. Let’s examine how to work with this file in this tutorial.īy default WordPress allows you to post content to your website in the form of either a post or a page. Wouldn’t it be nice if we had a way to change up the look of our pages in WordPress so as to easily differentiate them from normal posts in our theme? It turns out there is in fact an easy way to do this, and we do so by making use of the page.php file in our theme. As we know, it is the index.php file that is handling most of the heavy lifting with regard to HTML generation on our posts and pages at this time. Of course, our current theme is a very basic example of what you can do when creating a WordPress theme from scratch. ![]() Our adventures into this theme tutorial for WordPress is working out great so far. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |