Intermission.typepad.com
August 14th, 2008This is the new site for
intermission.typepad.com
also known as
writing the play
The typepad account has been closed!
This is the new site for
intermission.typepad.com
also known as
writing the play
The typepad account has been closed!
This is the first in a series of posts about WordPress and Intermission’s design. As I’ve posted previously, when I decided to move the site to a WordPress hosted site, I wanted to learn how to create a WordPress theme from the ground up. The WordPress Codex contains most of the documentation needed to understand the underpinnings of WordPress.
It bears oft repeating: read the WordPress Codex at Codex.WordPress.org
I hope this is obvious: The WordPress software must be installed on your server. The software comprises a lot of PHP scripts, some CSS and JavaScript files, and MySQL databases. The database aspect of WordPress, and blogging software, is what provides blogging its flexibility and instant publishing abilities. Your posts or pages are stored in a database. The old-fashioned HTML websites required your post, if you will, embedded in HTML code and then republished somehow to the web each and every time you edited your post. That’s a very clunky, very platform dependent way of publishing. With blogging software, generally you are creating or editing a database record which is then instantly displayed and formatted by your blog theme. Anywho… you can install the WordPress software and never touch it, except to update the software as needed. If you’re a little geeky like me, you might want to know more about the “core” of WordPress, and I’ll write a bit about my explorations of it in future posts.
A WordPress theme is what manages your site’s design. A WordPress theme is made up of several components: a style sheet (at least one, you can have more if you must), template files, functions, and images. Plug-ins are optional.
The style sheet is a CSS file which controls the fonts, the paragraphs, the formatting of your posts and site design. In the short time I’ve revamped Intermission, I’ve learned a great deal more about CSS and creating style sheets, and so I’ll be making adjustments to this site, or more precisely my style.css file, in order to make posts easier to read. Useful troubleshooting tools for CSS and XHTML code are the W3C CSS and the W3C XHTML Validators. (The only pages on Intermission that will not validate properly are posts with videos embedded. That’s another story…)
Template files are PHP script files. The PHP files generate the HTML and access the MySQL database for posts, pages, and whatever site information is needed. (All that WordPress dashboard stuff is stored in an MySQL table.) In theory, you only need an index.php template file, and a style.css. Ideally, you have at least the index.php, a header.php, and a footer.php. When you view a WordPress blog, the following files are called and put together to form the page you see: header.php, index.php, and footer.php.
The header.php, of course, contains the HTML or XHTML or DHTML or whatnotHTML header references (for compliant web design). Also the code for your header are included here. Thus, Intermission’s header.php contains my graphic, the website title information. The menu system, the quotation space, and the search box are also contained in the header.php because that’s where I wanted them, or where I found they worked best. Most sites would include these latter items in the index.php or sidebar.php.
The index.php contains the WordPress “loop.” A loop is a “do while” or “for” somethingorother piece of PHP code. For WordPress, you are telling PHP to do something as long as there are posts to display. In Intermission’s case, the loop displays the most recent post in full, and then the next 11 posts in extract form. If you use sidebars for various navigation items, the sidebar.php is called from the index.php. Intermission does not use sidebars except on the “About” pages.
The footer.php contains anything you want displayed in the footer. Usually this contains the name of your theme, any acknowledgements, copyright, and hosting stuff. You can put whatever you want displayed at the bottom of your pages in the footer.
You can include other template files for specific looks to pages, single posts, search, archives, etc. An exploration of how WordPress calls template files can help you determine what additional looks you want or need. The Codex has a great graphic representation of the template hierarchy.
Intermission includes single.php, pages.php, search.php, archives.php, and sidebar.php. Single.php is called when you click on an individual post. It works in conjunction with the header.php and footer.php. The pages.php and sidebar.php make up, along with the header.php and footer.php, the “About” pages of Intermission. Search.php formats the search results (if you type something in the Search input box and press the enter key…), and the archives.php formats the archive pages of the site. Finally, Intermission includes a 404.php template file for the displaying of an error message if a page you click on cannot be found.
Functions can be included in the theme, contained in an optional functions.php file. A function is a task specific piece of PHP code. Or… you can make use of WordPress Plug-ins. Plug-ins are written by the WordPress geek community, and contain PHP code, or PHP with a combination of JavaScript and/or Ajax code. Currently Intermission makes use of several useful plug-ins, which are listed on the Site Design page. For example, the Coffee House Wall uses a plug-in specific to allowing comments on a single page. I hope to write my own plug-ins as the new site evolves. I think learning to use PHP within WordPress helped me to make smarter choices in including WordPress Plug-ins. Not all plug-ins, nor are all themes, are coded well.
These posts will get geekier as they go along…next up will be a dissection of the MySQL tables.
No timeline on these, just goals for posts.
The next post, probably next week, will return to Thoughts on Developing Plays.
Tags: passing by, playwrights, quotations
Posted in Quotes
…I need to be in touch with my inner adult…who has always been lost to me except as an idea.
Simon Gray, The Smoking Diaries
Tags: passing by, playwrights, quotations
Posted in Quotes
In my opinion there is only one good reason to write a play: to change the entire world. I’m not kidding.
Michael Gene Sullivan, playwright, San Francisco Mime Troupe, Theatre Bay Area, August 2008, p.19
Tags: playwrights, quotations
Posted in Quotes