I've been experimenting with creating custom themes in WordPress, one of which is the interface of this blog. WordPress is remarkably easy to customize.
The first time I did this was for Dairy and Animal Science blogs. It is not what I would call perfect yet. It was also a tiny bit more complicated because
For the blog you are reading, I started with the Almost-Spring theme, designed by Becca Wei. Becca's style sheet is well organized and semantic, so it was easy to work with. I commenced from there.
I downloaded the files from wordpress.org/extend/themes. There are zillions from which to choose. Each consists of an image directory, a screenshot.png, several php files, and the stylesheet.
Except for minor tweaking, I was able to leave the php files alone. It was largely a matter of altering the stylesheet, replacing the images within their directory, and replacing the screenshot with one of the newly created theme.
I added an icon file named pia.ico to the root of this directory, and placed the following code in header.php between the header tags:
Finally, I changed the footer to reflect the new design.
Since this blog is hosted at an ISP, I do not have direct access to the code, so it was a matter of zipping the directory and uploading it. I was then able to choose the new theme from the theme selector.
That's all there is to it.
One thing I noticed about the code generated by this and some of the other WordPress themes is that the XHTML throws a validation error until you create your first post, at which time the error disappears. This is because posts are listed in the sidebar using an unordered list, and a fragment of a list tag is tied in with a php variable. So until there is at least one post, WordPress generates a closing tag without an opening one. Create a post; eliminate the error.
A small thing, really.
One last point: If you decide to customize your own WordPress blog, do remember to validate your XHTML and CSS and fix any mess-ups. The world does not need yet another site with trainwreck code.
The first time I did this was for Dairy and Animal Science blogs. It is not what I would call perfect yet. It was also a tiny bit more complicated because
- I picked a theme that contained rather a lot of embedded styles that had to be pulled out of the php files.
- I created several php includes and moved them outside the WordPress instances so that I could manage the appearance of several blogs with just a few files.
- Ditto the css.
- Ditto the images.
- I created some new php functions and changed others, which isn't necessary in most cases.
For the blog you are reading, I started with the Almost-Spring theme, designed by Becca Wei. Becca's style sheet is well organized and semantic, so it was easy to work with. I commenced from there.
I downloaded the files from wordpress.org/extend/themes. There are zillions from which to choose. Each consists of an image directory, a screenshot.png, several php files, and the stylesheet.
Except for minor tweaking, I was able to leave the php files alone. It was largely a matter of altering the stylesheet, replacing the images within their directory, and replacing the screenshot with one of the newly created theme.
I added an icon file named pia.ico to the root of this directory, and placed the following code in header.php between the header tags:
Finally, I changed the footer to reflect the new design.
Since this blog is hosted at an ISP, I do not have direct access to the code, so it was a matter of zipping the directory and uploading it. I was then able to choose the new theme from the theme selector.
That's all there is to it.
One thing I noticed about the code generated by this and some of the other WordPress themes is that the XHTML throws a validation error until you create your first post, at which time the error disappears. This is because posts are listed in the sidebar using an unordered list, and a fragment of a list tag is tied in with a php variable. So until there is at least one post, WordPress generates a closing tag without an opening one. Create a post; eliminate the error.
A small thing, really.
One last point: If you decide to customize your own WordPress blog, do remember to validate your XHTML and CSS and fix any mess-ups. The world does not need yet another site with trainwreck code.