Print Friendly

Featured Image

Attachments

Show Extras

The remaining theme files are setup similar to the index file created earlier. A call to the header, the unique page content, then a call to the sidebar and footer. Setting up these files will basically complete the functionality of your WordPress site. Of course there is a lot more advanced features of WordPress but here are the basic files you’ll need to run a simple blog. Just like with the previous posts, when editing these files replace all instances of MyTheme with the name of your theme.


404

The 404.php file is the page that displays when a link is broken or a page cannot be found. One thing to note in this file is that it is the error page I will be using for the whole site. So if someone is viewing an album in the Zenphoto CMS and an error occurs this page will be displayed. So before I can call the WordPress header I have to make a connection to the WordPress tables. That is why you will notice the first line of this file is unlike the rest in that it doesn’t immediately call the WordPress header. You can change the sentence beginning with “Apologies” to the message you want displayed when your visitors view the 404 page.

Archive

The archive.php file is used to show a list of files that fall within a certain date range. For instance if you click on a month in the Archive widget in my sidebar, the archive.php file will be called to display posts within that date range. For more information about it check out WordPress.org’s explanation.

Author

The author.php file is a template used to display information and posts by a specific author. This is mainly useful for WordPress sites that have more than one author. I am including it because it’s nice to have it in place in case I decide to add an additional author to my site. Here is WordPress.org’s information on it.

Category

The category.php file is the template used to display all posts within a certain topic. If you read a post and it says “Posted in:…” that is the category the post is under. If you click that category it provokes the category.php file and displays all posts in that category. WordPress.org has a good and thorough explanation here.

Comments

The comments.php file is used to handle all the comments and the comment submission. The file was too long to paste in a code box so use the comments text file. WordPress.org also has some information on it here.

Page

The page.php template is used for each page that you create in WordPress. It is pretty straight forward. If you want to know more check out WordPress.org’s description.

Single

The single.php file is used to display a single post. When you click on a post title and it displays the whole post and only that post, it provokes the single.php file.

Tag

The tag.php file is almost identical to the category.php file. Instead of showing posts by category it shows posts by tags.

Search Form

The searchform.php is the form for the input field and submit button of the search function in WordPress. This is just the layout of the form, while all the asthetics of it are are done in the CSS file.

Search

The search.php is the page that displays the search results.

Conclusion

I hope this has helped explain the rest of the WordPress theme files. I know my code is a mess because of the spacing and Word-wrap. I think it is a good learning experience for you to copy and paste the code and then have to go through and clean it up. This will help you read each line and understand what is happening. I know it takes more time to do it that way but at the end you will really have a more thorough understanding of the code. At this point in the tutorial you are basically done. Your site should be fully functional. The next two posts will just tie up any loose ends and the analytics.

Series Navigation<< WordPress Site Design – Zenphoto Integration

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

Copyright © 2013 DannyEckes.com. All rights reserved. | Site design by Daniel J. Eckes | Privacy