WordPress Wednesdays: It is All About the Query

HOWTOs WordPress

My last ten or so projects I have been working on all have a common theme: maximize WordPress’s ability to be a powerful CMS. Clients more and more are coming to me with the need to create a custom fields which they can store/query data throughout their site.

WordPress is completely customizable and because of this – it is easy to add custom fields to any post or page and then use the data put in them throughout the page.

Example: You have all your clients listed on your web site – and have created profile pages for them. Not only do you want to show their profile – you would really like to have a page template that shows all your client logos – and does so dynamically so that anytime you add a new client – their logo gets added to the mix automatically. The examples are endless and the solution is easy.

Step 1: Create a custom fields plugin (or use the generic custom fields) – personally I like to create a plugin so that I can completely customize and make adding content as easy as possible. If there is interest – I can cover how to create a plugin.

Step 2: Now that your data is stored – you can use it anywhere you want (in the loop, outside the loop). You can use something like:

ID, $key, true);?>

to display the data. (see Using Custom Fields for more information).

Step 3: Again – now that the data is stored – you can also query it so if you wanted to show all logos (as mentioned above) – you can do so by using WordPress’ query_posts to query and then display the data. (see Query Posts for more information).

Stuck? Interested? Let me know.

Leave a Reply

Your email address will not be published.
*
*

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Random

Linkfest Thursdays: June 4, 2009

There is only one link today – and that is to the video The Controverse 44. I have been watching Amanda Congdon for a few years now and finally decided to chime in on a question about the show “Jon and Kate Plus 8″…and she actually read my comment during the show (Twitter: superjank) Rock […]

Films

Media Mondays: Terminator Salvation

I was a die hard Terminator fan back in the 1990s. My sister and I watched the first two movies quite a few times on VHS. I have every edition of T2 on DVD and when I went to Penn State back in 1995 – I had already hung up 3 T2 posters in my […]