Archive for the ‘WordPress as CMS’ Category
Wednesday, May 9th, 2007
I am building a site for a client, and I want to list all the child Pages, which will be many, of one of their parent pages in the sidebar. To help you understand better, this client provides many services, so I wanted there to be a parent Page called “Services,” and this parent Page will have a list of child Pages, each of which goes into detail about each specific service.
I couldn’t find any information on how to do this, but then I came across a tag for categories that allows you to only list the subcategories of a specific category. This tag is as follows:
<?php wp_list_cats('child_of=8, 14'); ?>
By using this tag, you would only list the child categories of the categories with IDs of 8 and 14. So I decided to see if this would work with Pages, and it did!
So here’s the code I put in the sidebar to list only the child Pages of the Services Page, sorted alphabetically and omitting the title of “Pages”:
<?php wp_list_pages('child_of=2&sort_column=post_title&title_li=') ?>
Hurray!
Posted in WordPress as CMS | 32 Comments »
Tuesday, March 20th, 2007
Update: since I wrote this post, I discovered some problems with this solution. I ended up using a different solution, which you can see in Inserting editable text in the sidebar – part II: Widgets.
I created a site for a client based on WordPress that needed some dynamic editable text in the sidebar aside from the usual blog-type stuff like archives and categories. They had a section they needed to be able to update frequently and easily from the backend.
First I tried to use Kaf’s Get-a-Post plugin. I put the required code in the sidebar, and the owners of the site could edit the specified post and the updated content would appear on the site. But the plugin did weird stuff to the text that appeared under that part on the sidebar. It was creating links where there shouldn’t be links, and was changing the formatting of the h2’s.
Next I tried Kaf’s Welcome Visitor plugin. This creates a new link under Options in the backend, and on that page you can enter text in what is very similar to the regular WordPress Write Post or Write Pages format. On this Welcome page you can enter a title and text, and after putting the correct code on the sidebar (or wherever you want it to appear), that text and changes you make to it appear there. But this plugin had even more quirks: the Welcome link under Options only appeared to users with administrative privileges, and not to anyone else; and it disappeared on the front end to any users that are logged in to the site. So I ruled this one out too.
And then I found the answer: Improved Include Page plugin. I created a page with the name that should appear as the header on the sidebar. I made sure to code the header so that this page wouldn’t appear on the navigation bar by entering the following code where the navigation bar should appear:
<?php wp_list_pages('exclude=12&sort_column=menu_order&title_li='); ?>
12 is the page ID, and the “exclude” code tells the page not to display that particular page name in the navigation bar.
Then I put the following code in the sidebar where I wanted the text on that page to appear:
<?php if(function_exists('iinclude_page')) iinclude_page(12,'displayTitle=true&titleBefore=<h2>'); ?>
Now this code tells the page to display the Page with ID of 12. Title=true means it will display the title of the page, and titleBefore=<h2> means that the title will be styled with h2 tags.
And it worked! You can see the results here: www.kayema.com. Look at the top text on the sidebar, where it says “KSI Quote” – that header plus the numbers and date underneath are editable in the backend on the page called “KSI quote.”
Improved Include Page>>
Posted in Plugins, WordPress as CMS | 6 Comments »
Thursday, March 1st, 2007
The Page Links To plugin allows WordPress Pages to link to any page you would like. I recently used it on a site where the top nav bar is comprised of pages, but two of the pages – the news and resources pages – needed to have dynamic content that was pulled from posts so that the items on those pages would be easily manageable and organized (i.e. by date, author, tags, etc.).
I created two categories on the blog: News and Resources. I created two Pages: News and Resources. I then followed the directions of the plugin and did the following:
- Scroll down to the Custom Fields.
- Enter links_to as a key.
- For the value, I entered the URI of the category that I wanted to link this page to as the value of the key. So for News, I clicked on the News category on the blog page to get the URI, and copied and pasted that URI into the value field.
Now, when users click on News on the nav bar, it displays the news page as it would appear in the blog. I think that this plugin is another example of how WordPress can be used as a CMS. Excellent!
Page Links To>>
Posted in Plugins, WordPress as CMS | No Comments »
Thursday, February 22nd, 2007
Christian Montoya over at the Montoya Herald says he understands why many web developers use WordPress as a CMS system instead of the many other systems that are not blogging platforms, but CMS systems themselves.
All of these CMS’s have rather complicated administration interfaces, tend to be difficult to theme, and usually don’t put as much emphasis on syndicated publishing as blogging software. It’s really interesting when you think about it; after all, on a typical website you might publish a couple handfuls of static pages, whereas you might have a fresh news posting every week. Doesn’t it make sense for a platform to emphasize news/blog content over static pages? Moreover, if you are going to hand something over to a client, it’s natural to opt for something that non-technical people can use (and do every day). When I tell people “updating this site is just like updating your Livejournal/Xanga,” that’s one of the great things about Wordpress. It’s the combination of the simple admin interface and the focus on blogging (even when the end result is not a blog) that makes Wordpress ideal for most simple sites that I would build for a client.
He does point out that WordPress has its limitations, which makes sense since it’s goal is to be a good blogging platform. But he sums up with a good point:
…content management systems shouldn’t just be about offering more features and functionality for the developer, but being user-friendly for the client too.
I have started to use WordPress as a CMS system because it is relatively easy to theme and customize, and web site owners can easily update their content.
Posted in WordPress as CMS | No Comments »