The Get Custom Fields plugin is an extremely versatile WordPress Plugin. It's really like having dozens and dozens of plugins rolled into one, once you get used to the idea behind it.
To make this work you assign values to custom fields in the 'custom fields' entry on your post form. Then, with a simple call to the c2c_get_custom_fields(); plugin function, you can display these little bits of custom data in your blog. You can display them either in the loop or outside it.
The first step is to add a custom field key/value pair. At the bottom of your post entry form you'll see this.

Now lets say we want to include a certain type of data with every post, but we don't want to display it in the post. For instance with a picture blog we might want to include the camera we used.
So we could create a key named 'camera' and in one post give it the value of 'nikon esf1000' and in another post we could give it a value of 'Kodak OL125' (These are fictional cameras and I doubt they exist). Now in the template for the blog single post we can create a div for picture details and call the c2c_get_custom_fields(); function to display the camera used for each shot. This could be a div that is floated at the top of the post, or it could even be listed in the sidebar. We cold also include custom fields for the light readings, location, film, shutter speed, and whatever else a photographer might be interested in.
Any fields we call with this plugin, that we do not define in the post custom fields entry, will simply display nothing, unless you include a special "none" text with the function.
Another use for this plugin would be to use it as a conditional operator. Lets say we want to do some interviews in some of our posts, and we want to include a special section on those posts detailing some information about the person we are interviewing. We could include a key called 'interview' and give it a value of 'yes' on interview blogs. Ten we can simply use an if(); function to see if the interview key has a value of yes. If it does we can include the special biography section of code, which could use custom fields defined about the interview subjects, or if not, skip the whole section.
You can visit the Get Custom Fields plugin page, for exact instructions on how to implement it in your templates, and I will be posting some examples soon.
Right now if you visit one of the tag pages on this blog, the description of each post is actually being pulled from a custom field I set up called 'oneliner'. It just has a short one sentence description of the post, so that I can display that on my tag pages, and save my excerpts for my category pages, which are more frequently visited in any case.
Trackback URL for this post:
Bookmark & Share: Click, Copy and Link:







