When I first stumbled across WordPress (which I’m using to power my website), I was very pleasantly surprised by the excellent administration environment, and just how easy it was to setup and use. Before I even decided what tool I was going to use for my website, I had come up with a basic design and color scheme that I was going to use. I managed to stay pretty close to what I wanted, but there were several things that made it a bit trickier than expected.
In order to get my custom ’skin’ for WordPress I needed to create a theme - this is pretty easy as a theme is really only composed of a few pages. The template tags used to create a theme are relatively straightforward and I was able to get something up and running very quickly. The difficulty is that the template tags are aimed at very novice users, which means that they hide a lot of complexity. And while hiding complexity is often great, it also means added complexity when you try to do something that is a little outside of the feature set.
For example, WordPress has a feature called ‘Pages’ where you can create regular posts that act more like static pages and aren’t blog-like. In addition to not sitting within the standard blog flow, pages can have child pages so you can build a hierarchy of pages. An example of ‘Pages’ on my site is the ‘About‘ page you can see linked on the left. If I wanted to I could write a sub-page called About Me with sub-pages for My Education, My Resume, and My Hobbies. Now I don’t really have anything on this page, so I guess I’m giving a bad example - but you’re smart, you can imagine it.
While it was possible to create a hierarchy of pages, the only place to show it was really in the navigation bar on the left. Obviously this isn’t acceptable if you have several levels of nesting - the left column isn’t big enough. You can limit the ‘depth’ of the tree, but then the lower levels aren’t shown anywhere, and a page that no one can get to just isn’t too useful. I wanted two additional things:
- To show a breadcrumb under the page name which would have links to all of the parent pages
- To show a list of child pages
I understand that Pages were only introduced in the current release of WordPress, but these seem like two very obvious requests. The unfortunate thing with doing these is that the API provided by WordPress is so targetted at its own templating that it requires a developer to talk directly to the database to get data. Most of the template tags return data with HTML embedded, so if you want to use the data for another purpose they become useless. Using the WordPress plugin functionality I was able to write a class which augmented the standard Pages feature set with some useful functions.
I understand that the template functions return HTML to simplify things for the user, but it would be great if there were some lower-level functions which returned information as data (i.e. returning an array of child pages) so that the user can choose what to do with them. So while it might be easier to write:
get_child_pages($id)
I would personally rather write:
$children = $page->getChildren();
foreach ($children as $child) {
// do something
}
I think that this actually ends up being more readable because it’s not as spooky - you can see exactly how the data is being rendered on the page, and if you need to make a change to it you can do it write on the template instead of changing the source code of the API.
But….overall I’m very happy with using WordPress and how flexible the system is. I wish the team continued success with the project!
July 22nd, 2005 at 12:48 pm
Hello Mr. Greg without an email address!
I was wondering if you would be kind enough to post your hack for the breadcrumbs. It would be much appreciated.
Thank you kindly, kind sir!
September 20th, 2005 at 8:52 am
I’m currently working with Breadcrumb Navigation 0.8.8 and trying to get it to do what you’ve so successfully done for subpages here on your site.
I’m developing a site for a graduate school at a university in Boston and have to match existing technology to be sure they’ll be accepting of a Wordpress solution. Would you be willing to details how you programmed your pages and subpages to appear in the breadcrumb trail? I’ve already hacked to pieces a number pages and plug-ins, but this one has me stumped.
I also like how your subpages appear in a secondary menu floated on the right. Very nice design!
September 22nd, 2005 at 10:54 pm
i’ve added my plugin (and the template page that uses it) at the following location:
http://www.gregphoto.net/download/subpages.zip
enjoy…
greg
September 22nd, 2005 at 10:58 pm
[…] Wordpress - the great and the not so great […]
September 20th, 2006 at 6:32 am
Hello Greg. Nice of you to share! Is this plug-in compatible with later versions of Wordpress?
Best regards, Jakob G.
September 20th, 2006 at 8:19 am
@Jakob - seems to be compatible with the latest Wordpress…as I’m currently running it on 2.x. It’s a very simple pluggin…it’s only real downside is that it requires changes to template files. I’m sure someone who is more knowledgeable in wp plugin development could make the process cleaner….
Greg
October 7th, 2006 at 3:56 pm
Cool! Thanks, I’ll give it a try
January 23rd, 2007 at 7:15 am
Hey Greg, I just wanted to drop you a note to say thanks so much for sharing this. I am in over my head (nearly
) getting a WordPress powered site working and I’ve never attempted anything like it before. I experienced exactly what you wrote about regarding trying to get a clean list of child pages and it was making me lose sleep. Thanks to you I’ll sleep tonight. Cheers!
January 29th, 2007 at 10:02 pm
I just upgraded to WP 2.1 and this subpages plugin no longer appears to be working. My page is simply blank where my list of child pages used to be. I’ve read they made a change to the WP database. Is there an update to this plugin so it will work with WP 2.1? Please let me know as this plugin does exactly what I want.
Thanks
February 9th, 2007 at 2:30 pm
Hi, id just like to say i tried WP but im sorry for the type of site i wanted i found DW MX and Actinic jut the ticket. But i do see some of the good things that could be useful
April 25th, 2007 at 11:36 am
does this plug in work with late versions of wordpress?!
____________________
http://top10songschart.com/
October 13th, 2007 at 12:44 pm
yeah. I wonder it too. is it work for wordpress 2.3?
October 19th, 2007 at 10:15 pm
I do like the latest design or wordpress. Compared to blogger it was more an excellent choice if your going to used wordpress. The design and template is more professional looking and creative as well and the template is superb but what I don’t like is the added nofollow plug in but upon searching about this I have find out that we can turn off those type of plug in and choose dofollow plug in in exchanged for such nofollow plug in system .
November 7th, 2007 at 11:53 am
please more info if this plug works with the latest WordPress ?
December 13th, 2007 at 9:04 am
I tried using the plugin in the new wordpress but it does not seem to work.. it just merely shows up blank on my blog.. the child pages are not working.. maybe you could help out greg .. thanks very much
December 25th, 2007 at 9:52 pm
I love WordPress — the plugins are so powerful and it can be extended in so many ways. I.e. as a Digg-clone, message board / forum, brochure site, etc.
And tens of thousands of prebuilt themes to boot…
January 10th, 2008 at 5:15 am
wodpress is great that you make many pages everyday but the cons is it loads the pages slowly.
March 5th, 2008 at 10:04 am
Yes I agree the wordpress is still slow. http://www.estetiks.com/