After my rewarding and yet deeply frustrating results in Week 13, I took the weekend off from web development and let the problem percolate in the back of my mind. At some point -- I think I was in the shower, which is where I usually am when these things happen -- I had an idea.
I had been trying to give Wordpress a new "theme," to use their language -- that is, to strip it of its out-of-the-box default look and dress it up in my pretty CSS. At the end of the process, my site would have been a Wordpress site dressed in my site's clothes. This would be the cleanest and most elegant way to solve the problem. But the complex interdependencies between the chunks of HTML and PHP that make up Wordpress probably make this solution unsuitable for my level of skill. I spent the weekend worrying, justifiably, that I wouldn't be able to do it, and wondering whether there was another way to make Wordpress do what I wanted it to.
But now I realize that this was the wrong question. I shouldn't be trying to change how Wordpress looks; that is too enormous a project. I should be trying to change how my website runs. I am not a tailor. I should not be trying to strip Wordpress down and dress it up. I am a surgeon. I should be doing an organ transplant. I need to identify the bits of PHP that make Wordpress display the blog, and then copy-paste them wholesale into my nice handmade index page, completely free of the baggage of Wordpress's default theme. It is such a simple solution that it's hard to believe it isn't the first thing I thought of.
So I booted up Dreamweaver, and twenty minutes later I have an index page that uses my CSS and shows Wordpress's blog. It was so easy. I couldn't believe how easy it was. It only took two PHP commands. Wordpress's back-end took care of the rest.
There are still problems. When users click on any of the links within a blog post -- on the Leave a Comment link, for instance -- they're redirected to a page that still uses the Wordpress default theme. I think I should be able to solve this the same way I solved the original problem, though, and if not -- well, hopefully users won't be too confused by the mishmash of styles involved in searching the blog or commenting on a post. I'd also like to restyle the internal CSS of the blog component. But what's important to me is that my blog is now usable! Particularly if I can solve these secondary problems, the blog will really be the capstone of the semester for me. I'm so happy to have gotten it working. :)
No comments:
Post a Comment