Click here for HomePagewww.RadMod.com
St. Louis, MO USA
The Radical Moderate
Covering: Big Brother, Propaganda, Theocracy and Liberty
By Tim Willoughby, Y.A.W.L. *
(* Yet Another Wretched Lawyer)

 
HOME RM's Platform RM's Quals About the RadMod TimsLaw.com
 

Libertarian Democrat

A Libertarian Democrat is vigorously pro-personal liberty, and believes government can play a constructive role in regulating our economy and providing a social safety net.

Categories:

About

Help Beta Test:

  • The RadMod is trying to convert an old fashioned HTML business website, TimsLaw.com, over to Wordpress. Feedback on how TimsLaw works would be appreciated.

Credits:

Internal Links:

A Moderate Motto:

"Few things in life are as good or as bad as they seem in the emotions of the moment."
--- An Anonymous Moderate

Wordpress as a content management system
Posted in Category: WordPress

Wordpress as a Content Management System

(WORK IN PROGRESS)

[Some updates spread throughout this article on April 15, 2006, and April 19, 2006]

SubParts of this article:

Introduction to my WordPress projects, one is a business site, and one is a blog

I am trying to provide somewhat of a roadmap for those who follow me in trying to tweak Wordpress into being an adequate content management system. Wordpress is good enough to use for something other than a blog. It’s a light content management system.

See my WORDPRESS category of articles for much more on my trials and successes in trying to port an old-fashioned HTML business website over to Wordpress.

Here’s one of my main blog articles talking in real time about a Wordpress experience: Converting an HTML business website to Wordpress.

Although I am blogging about WordPress here on Radmod, the business website I am converting to Wordpress is TimsLaw.com. [UPDATE 4-15-06 - My business site has been LIVE on Wordpress for about 2 weeks now, and is functioning fine. I can tell from my server logs that pages are taking longer to load now, because of the timing of the loading of the stylesheets and template pages. So far, I’m not losing any visitors, it appears, due to the delays.] For about a month or so prior to going live, I used a temporary URL to hold my conversion code, to give my web browser a place to land. The temporary URL, MissouriJobLaw.com, is still live, but it points to TimsLaw.com now.]

I use a similar theme on both RadMod and www.TimsLaw.com. But I’ve spent more time on the business site’s template, as you can see if you visit.

The only major feature I have NOT duplicated between the websites, as of April 15, 2006, is Dagon Sitemap Generator. I couldn’t get Dagon Sitemap working on RadMod.com within a few minutes one day, so I aborted the install. I’ll try again sometime later. Dagon works fine on TimsLaw.com.

I installed SEM Search Reloaded on TimsLaw.com, and then brought SEM Search over to RadMod. The only problem with SEM Search is the inability to get pagination of results. So the search results are limited to evil Posts Per Page setting in Admin. I’ve got an article about Posts Per Page being evil around this site somewhere.

I am experimenting with Ultimate Tag Warrior (I formerly experimented with Jerome’s Keywords) on www.TimsLaw.com (But not RadMod), as an experiment, to see if Keywords are more user-friendly than Categories. (It appears they ARE!).

And now, ISSUES and ROADBLOCKS
in using Wordpress for something other than a blog

Some of these issues will have been covered extensively in my other Wordpress articles. Here in this current article, I might only list them generically.

Why Wordpress?
There are several other php - based blog-type packages out there.

I checked out some of the others, like typepad, moveable type, xoops. I actually installed some and played with them.

Here’s what I found after trying the programs and then researching them on the web:

  • Wordpress was pretty mature, as mature as moveable type, and was open source.
  • The Wordpress team seemed to be the most active in trying to improve the product.
  • And Wordpress enjoyed the broadest plugin support. I KNEW I’d want a lot of plugins, because I’m not a php programming pro.
  • I didn’t really want anything proprietary, or anything I could not tweak by learning enough php coding.

And so, the signs pointed to Wordpress as worthy of a serious trial.

In about May of 2005, I converted my Blogger blog over to Wordpress. And now I’ve have about 10 months experience with Wordpress.

Wordpress passes my tests, so far, as being pretty much what I expected.


The troublesome “posts_per_page” design scheme, making it harder to to get good quality “Category Display” and “Site Search” features

[update - I posted an article about Posts Per Page being EVIL ]

A business website is required to have a good useful means of displaying its content, organized into categories. The default untweaked Wordpress “display category” - type of features are not impressive.

Moreover, the built-in Wordpress search function is actually unacceptably weak.

So I needed an archive display program, and I needed a good search program.

For a long time, I fussed with DC-Nicer-Archives as a means of displaying lists of content, whether the lists were produced through a search, or through the user clicking a Category. [UPDATE 4-15-06 - DC Nicer Archives is GONE from my websites. DC worked good in WordPress 1.5. But it has problems with WordPress 2. And the author seems completely uninterested in updating this very nice and popular little plugin. So I abandoned it. If the author ever gets interested in the Nicer Archives plugin in, I’ll give it another shot, and probably become one of its biggest boosters.]

So, without DC Nicer Archives, I’m stuck with the unimpressive but functional WordPress category archive display functions.

The use of TAGS (Ultimate Tag Warrior) gives my nusiness site a second means of categorizing articles, so I’m gruntled now (as opposed to dis-gruntled).

I chose SEM-Search-Reloaded to find more relevant articles for my searchers.

Some Big problems ensued with both DC-Nicer-Archives AND SEM-Search-Reloaded, due to their “posts_per_page” method of determining how many articles to list on a page.

The Wordpress database, in the Posts Table, has a data field called “posts_per_page“.

The Admin interface allows you to manually set posts_per_page to whatever you want. The default is 10, I think.

Does the “posts_per_page” setting affect anything other than the number of posts automatically displayed on the front page?

You bet your sweet ass posts_per_page affects more than just setting the number of articles that appear automatically on the front page. It controls how many POST TITLES will get listed by the Search, Category, and Archive features.

Wordpress, and ALSO some popular plugins, rely on “posts_per_page” to tell them how many titles to put in a list of post titles. So, if you’ve set your Wordpress to show 3 posts per page, then your Homepage will show the latest three posts. But so will your SEARCH and CATEGORY features - they’ll be limited to 3 post titles at a time (at least that’s how MY Wordpress works).

That doesn’t make any sense to me!

Why would I want Search Results limited to 3, just because I only want three whole articles to appear on my frontpage at one time? Let’s say I have 20 articles under a Category. When a user clicks a Category, don’t I want ALL 20 TITLES to be listed? YES! But only 3 titles will be listed if my “posts_per_page” is set to 3.

Plugins seem to be inclined to OVERLY-RELY on posts_per_page in deciding how many things to display on the page. For two examples, check out the DC-Nicer-Archives plugin’s function code file. Check out the SEM-Search-Reloaded plugin’s function code file.

I STOPPED using DC-Nicer Archives as of March 22, 2006 on RadMod.com. DC Nicer Archives resets “post per page” to 9,999 - breaking my admin interface unless tweaked

DC-Nicer-Archives is the WORST offender. DC-Nicer-Archives actually RESETS a posts_per_page variable to 9,999. I found that when this variable was reset to 9,999, it broke my Wordpress admin interface, because the post management Admin interface tried to list 9,999 articles.

Before I deleted DC, I tried manually tweaking the DC-Nicer-Archives core functions on RadMod.com to have it reset the posts_per_page to only 100. That’s a kludge, but DC stopped breaking my Wordpress Admin interface. But the Admin interface then showed 100 posts, rather than the default hard-coded 15 posts. But I’ve given up on DC now.

I tried tweaking SEM Search Reloaded

SEM-Search-Reloaded also relies on the global Wordpress post_per_page setting. SEM Search uses posts_per_page to determine the number of search results to return for displaying.

So I tried manually tweaking the SEM Search code file to hard code “10″ into SEM-Search’s internal variable where it stores the number of posts_per_page. With the tweak, I could set my post_per_page at 1 if I wanted, and still get 10 search results. So, although I get much better search relevancy with SEM-Search-Reloaded, my users would be limited to finding 10 articles at a time. I could increase the number easily, by editing the SEM Search plugin php file, but SEM-Search defaults to also producing excerpts of the articles it finds, and so the Search Results page gets long, even limiting the posts to 10.

Later on, when I started setting a larger “posts_per_page” setting in the Admin screens, I removed the SEM Search tweak and restored the original SEM Search Reloaded plugin. So, I once again allowed SEM Search to be controlled by the Global “posts per page” variable.

But still, SEM-Search fails to “page” the output. And so my users only get the TOP 10 search results (or whatever I set as “posts per page” results in the Admin screens).

SOLUTION to the posts_per_page problem: Wordpress needs to declare a few global variables (or classes or data fields in the database) to store the number of “SEARCH RESULTS” or “CATEGORIZED ARTICLES” to display. May I suggest: “search_results_to display” and “archive_results_to_display”. Also, the Wordpress Admin interface needs to give the user a means of setting these variables.

It makes no sense that the number of mere titles to be displayed in a Search at one time would be controlled by the number of whole articles to be displayed at one time on the Front Page of the site.


For a discussion of the use of PAGES vs POSTS (I use POSTS) …

See Converting an HTML business website to Wordpress.

By the way —- If you use PAGES for anything, DON’T SPECIFY ANY TEMPLATES! They aren’t really templates. They are hard coded pages, just like the old days of pure HTML.

Rather than use “templates” for “pages”, just click “Write a Page” in your Admin screen. Then start typing your text in the block as you would a regular blog post. Wordpress will then plug your “Page” into the standard Wordpress Loop that it uses to display Blog Posts. When you change your theme, the changes will automatically propagate to any “Page” displayed, just as such changes automatically propagate to any “Posts” now.

If you try to specify a “Template” for the “Page”, the template had better be a reproduction of your entire Index.php file and all sidebars, etc, or else the page won’t look like your website. Then, you’ve got a darn near “hard coded” complete webpage page, just like back in the old HTML days (boo) - and you can’t easily change the way the page displays, and you must edit EACH “Page” manually (except for any “Included Files” called from your code. This is retro, not dynamic.


Reducing load times

Ever notice how your PHP website sometimes CRAWLS? Me too. We need to keep the amount of processor time down, to keep the speed up. Most of us are on shared servers, and we are competing for processor time with lots of OTHER websites. As PHP - based sites become more numerous, the webservers are groaning under the pressure.

Getting PHP OUT of the sidebars

I thought about it and I realized something: The only part of my front page that changes regularly is the Recent Post listing. Yet, I was using LOTS of PHP code to dynamically generate my Links List, and my Category List, and even recalculate how many posts appear in each category. Sometimes during high server loads, my site would stop responding for a minute.

When I myself encounter a site freezing up like that, I leave the site.

We DO NOT want our visitors leaving us, so let’s reduce the number of PHP database queries.

So I hard coded much of my template, all the links and categories, except for the display of “recent posts” in the sidebar. The site loads considerably faster now, with fewer database queries. My template is 5 files, on both my sites: Top, Leftcolumn, Middlecolumn, Rightcolumn, Bottom. All those files are hard coded as much as possible for speed. I’ll have to manually tweak a file if I want to change a link, but that doesn’t happen too often, or if I add a category, but that’s rare on a mature site anyway.

Pre-processing the articles rather than having Wordpress re-format them on the fly

Next, I think I’m going to play with a plugin that “pre-processes” the articles and stores them pre-formatted in a special database table. Currently, Wordpress has to re-format the articles on the fly, each time someone wants to see an article.

It would be better if the old articles were already formatted, and could just be pulled from the database and displayed.

[Update - I haven’t had the courage to try any preprocessor plugins yet. I’m leary of using plugins that are SO intrusive. The risk of catastrophic failure is much higher than I’m comfortable with. So I’m choosing to just tolerate the occasional slowness of the sites.]


I’m using Ultimate Tag Warrior on my business site, www.TimsLaw.com, as a replacement for categories in the primary user interface.

Get Ultimate Tag Warrior 3. This plugin has an admin interface, and lets you add tags when you write posts, and point and click at existing tags to add them to your new post.

Tags work kind of like categories. See this fine article describing the process of
using Tags to organize your Wordpress content rather than categories
.

The tags can be made to display under your article title. I say something like: “Related Posts in:” and then the taglist is displayed. When the user clicks a tag, they see a nice list of artciles and excerpts, for each article that carries that tag.

I’m still playing with creating a tag-based sitemap over at www.TimsLaw.com. But I can’t get it working yet. I don’t like the bloggy faddish “Tag Cloud” style of tag-sitemap provided by UTW, not for a business website.

I have not implemented UTW on RadMod.com yet, primarily because of the sheer volume of articles. I’ve got hundreds of articles on RadMod.com, and I just can’t get enthused enough to edit them to add tags.


Search engine optimization: Adding Meta Description and Meta Keyword fields into the header

Go to Webmasterworld.com to learn about search engine optimization.

Wordpress does not automatically put “meta description” and “meta keyword” fields in the head of your displayed document. I use the following on www.TimsLaw.com ——–

Head Meta Description Plugin

I got the Head Meta Description plugin. This plugin works nicely in grabbing an excerpt from your post and placing it dynamically into a Meta Description tag. I haven’t yet manually created formal excerpts for the articles I manually converted to Wordpress, so the plugin just grabs the first 20 or so words of the post. When I get around to creating excerpts, the plugin will grab those excerpts instead.

I tweaked the head-meta-desc.php file to display a special phrase after the end of each description. All I did was type some text into an existing function as follows -

FYI - The Wordpress pre-processor seems to have a problem displaying the following code snippets as “code”, despite my < c o d e > < / c o d e > tags, and executes the code instead. So I’m gonna bastardize the code a bit or else it RUNS not displays. The META word in the code F’s up the Wordpress pre-processor especially, it seems. To FIX the code, close-up the “( $ ” then put the braces in where indicated, and then close up the extra spaces in the words “E C H O” and “M E T A” [Yes, I’ve looked into Code-related plugins, but they are too intrusive and/or glitchy, it seems to me. Read their documentation and you’ll see. Plus, I don’t want extra non-core “filters” added by plugins - filters that sit between me and the database.]


if ( $ description) [left curly brace]
e c h o "< m e t a name=\"description\" content=\"$description - from Tim's Missouri Employment Law Info Site - www.TimsLaw.com\" />\n”;
[right curly brace]

Tweaking Ultimate Tag Warrior to make it help put a dynamic Meta Keyword field in the header

MAKING ULTIMATE TAG WARRIOR INSERT META KEYWORDS INTO YOUR PAGE’S HEADER:
Great little tweak from Andywibbles.com

Put this code in the ultimate-tag-warrior-core.php at about line 1389 in my version where the “predefinedformats” are being defined - This code is from Andy Wibbles - FIX by closing the ” M E T A” extra spaces, and by closing the extra spaces in ” $ predefined Formats ” —-


$ predefined Formats ["metatagkeywords"] = array ("pre"=>"< m e t a name=\"keywords\" content=\"", "default"=>“%tag%, “, “first”=>”%tag%, “, “last”=>”%tag%”, “post”=>”\”>”, “none”=>”");

Then put the following command into your theme’s “header.php” file —– FIX by closing the extra space between the “< " and the "?php" in three places in the codeline ----


< ?php if ( is_single() ) { ?> < ?php UTW_ShowTagsForCurrentPost("metatagkeywords") ?> < ?php } ?>

A tweak to Andy’s code by Tim - Here is the code I put into my ultimate-tag-warrior-core.php file —— FIX by close extra spaces in ” $ predefined Formats ” and in ” M E T A” —–


$ predefined Formats ["metatagkeywords"] = array ("pre"=>"< m e t a name=\"keywords\" content=\"", "default"=>“%tag%, “, “first”=>”%tag%, “, “last”=>”%tag%”, “post”=>”, Missouri, Employment Law, Lawyer, Attorney, Tim Willoughby\”>”, “none”=>”");

After updating your Wordpress blogfiles to include the tweaked versions, check your results by loading a page and “Viewing Source”. The header should now show a Meta Keywords field populated by your ultimate tag warrior keywords that were assigned to that post.


Putting only a Single Post on the front page, excluding posts from certain categories

This is an alternative to the static homepage. For a static homepage, the Wordpress Codex gives several techinques. But if you want your most recent stuff to automatically appear, except for posts in certain categories, then I’ve found a way to do that.

For example, I wanted my Wordpress political blog at Radmod.com to show only 1 article on the frontpage, the very latest. BUT, I did not want the featured article to be my latest “Wordpress”-related rambling, or my latest silliness categorized under “diversions”. I wanted it to be a political article, in line with the blog subject matter. Code follows —–

Try this code in your index file, directly below the first line of LOOP code

The Wordpress LOOP is the codeblock that starts as follows: [close up all spaces to use]
< ? php if ( have _ posts ( ) ) { while ( have _ posts ( ) ) { the _ post ( ); ? >

Right below the start of the Loop code, I inserted the following: [close up all spaces to use]
< ? php if ( is _ home ( ) ): ? > < ? php if ( in _ category (16) or in_ category (15) ): ? > < ? php continue; ? >< ? php endif; ? > < ? php endif; ? >

Here’s how my code works:

  • If we are on the homepage … [Wordpress knows if the user wants the site-root (homepage) or wants a specific article. If we’re on a specific article page, don’t do anything, just display the article as normal] ….
  • … Since we’re on the Homepage, now see if the First Post’s category is 16 or 15 …
  • …….. If we’re on the homepage, AND the category is 15 or 16, then invoke the ‘continue’ command, which skips the rest of the Loopcode and returns to the top of the Loop and works on the next post … [by “continuing” we skip the display of that post]

And my code will test each of the latest posts, until one of the posts is NOT in category 15 or 16. The first post in some truly political category will be displayerd, having skipped all the Wordpress or Diversion category posts.

Once the Loop processes a post, I have a BREAK command at the bottom of the Loop, to prevent the Loop from getting a second post. [close up the extra spaces] —

I put “< ? php break ; ? >” at the bottom of the Loop just above the following:
? php } } else { // end if any posts


Getting rid of the Customizeable Post Listings plugin, and using query_posts instead

I’ve figured out enough about the query_posts ( ) template function in WordPress 2 let me stop using the Customizable Posts Listing plugin. querry_posts can do the exact same thing I was using customizable post listings to do: display a set number of the latest articles from spefic categories.

Here’s the query_posts code from the RadMod.com side column, to show recent posts: [you can’t use this code without cleaning up the extra spaces, but it’ll tell you enough to let you know how to get the query_posts function to work for you too, I think.] Check out the WordPress Codex query_posts template tag page - That’s where I got the basic code.

Code to display the latest 10 titles from specific categories only, using query_posts

< ? p hp query _posts ( " cat = 14,3,17,4,6,1,10,13,8,2,18 & showposts=10 " ); ? >

< ? p hp if ( have _ posts ( ) ) : ? >

< ol style = " padding - right: 8px; " >

< ? p hp while ( have _ posts ( ) ) : the _ post ( ); ? >
< li class = "recent-post" style = " padding : 5px 0 5px 0px;" > < a href = "< ? p hp the _ permalink ( ) ? >” rel = “bookmark” title = “Link to article” > < ? php the _title ( ); ? > < / a > < / li >
< ? php end while ; ? >

< / ol >

< ? p hp else : ? > < d i v align = "center" > Not Found < / d i v >
< ? p hp end if ; ? >


I want VERSION control in WordPress

What does Version Control mean?

In a business setting in particular, it would be nice to be able to have an easily accessible record of the things we have published to our customers, over time.

Businesses often are confronted with customers who say: “Your ad said (something crazy that you KNOW you didn’t say)”. Litigation might occur, and you might need to prove conclusively what you said.

But WordPress makes it SO easy to edit articles, that you will be encouraged to make frequent edits as the mood strikes you. Most edits will be inconsequential. But what if you make a BIG change? What if you change the pricing, etc …. ?

How can you easily prove what you said, three months ago, or three years ago, on a particular part of your website?

Currently, the best way is probably to refer to your database backups (you do backups periodically, right?). But that’s clunky and unprofessional.

If we had VERSION CONTROL features, the history of our websites would be EASY to reconstruct:

  • WP would Auto Create a backup of a Post EACH time I EDIT it.
  • WP would let me enter a description of the backup, to explain why I edited the Post
  • WP would retain the entire edit-history of each Post in the database, ALL versions of the post back thru time. [compressing the archived post might be an option to save space]
  • WP would let me selectively delete unwanted backups of each post
  • WP would let me Restore from Backup, on a post-by-post, and version by version, basis.
  • WP would let me Display from History, for my own internal use, in case I needed to review and print out an older version

More to come ….

 

END of article
    (Printable version)    

 

One Response to “Wordpress as a content management system”

  1. Abhijit Nadgouda Says:

    Interesting post. I was part of a team to create an article management system using Wordpress at ManojKhatri.com to create a network of authors.

    Our biggest problem, especially in the article management system was to wrap the Wordpress post as an article. The biggest hurdle I feel is that Wordpress inherently does not support creation of different content types. Otherwise it rules!

    Regards,
    Abhijit.

Leave a Reply



Link:
Wordpress as a content management system

by on Thursday March 9, 2006.
Category: WordPress.

 

PREVIOUS post in SAME category as this post:
UPDATED - Converting a business website from old-fashioned HTML to Wordpress

 

NEXT post in SAME category as this post:
New theme

The RM is a "Libertarian Democrat"

A Libertarian Democrat is vigorously pro-personal liberty, and believes government can play a constructive role in regulating our economy and providing a social safety net.

Lawyers Must
Speak Out!

We must keep our ears tuned to the degeneration toward tyranny.
See Justice O'Connor's Warning.

Recent Rants:

  1. Interpetting that Roger Ailes joke about Obama, Bush and Terrorism
    in Cat: Propaganda-Media
  2. Example of Dem wingnuttery in an extreme gun ban bill (it’s probably DOA tho)
    in Cat: Politics-misc, Libertarian
  3. 11th Circuit says no right to sexual privacy, upholds Alabama ban on sale of dildos
    in Cat: Theocracy, Libertarian, Law-Courts
  4. The era of Republicans ignoring the Golden Rule has ended
    in Cat: Politics-misc
  5. National Park Service no longer discusses age of Grand Canyon - Bush further muzzles science
    in Cat: Science vs Religion
  6. Disease of willful ignorance
    in Cat: Politics-misc
  7. St. Louis County touchscreen voting: Great news and awful news
    in Cat: Politics-misc
  8. GOP merges terror and culture wars: Porn prosecutions UP, Crime -Terror prosecutions DOWN
    in Cat: Libertarian, War
  9. Skeptical Maxims about Polls and Democrats
    in Cat: Politics-misc
  10. Bush admin, not Clinton, screwed up with North Korea
    in Cat: Propaganda-Media, War

Links:

Politics
Anti-Theocracy
Media Watchdogs
  • MediaMatters.org
    Former right wing propagandist saw the light, and shines light on right wing media
  • NewsBusters
    Focusing on liberal bias in the media, food for thought for moderates and liberals
  • Newshounds
    The NewsHounds keep a close eye on the FoxNews propaganda machine
Misc
HOME  | Top of page  | Tim's Employment Law site - www.TimsLaw.com

CONTACT the RadMod

[powered by WordPress.]

Get Firefox!