(Update added 06-08-2004 10:50am)
I am testing a WP feature, the meta custom fields. This post will show what I’m reading, eventually, if I can make it work. Does it show up?
Yes it is working. Here’s what I did, as I wrote on the WP Support Forum:
OK Here’s How I Did It just now:
I made a post and created a "Reading" key in the custom fields area below the writing area of a post. In the "value" I put a book I’m reading.
I then saved the post, and then chose the drop down "select" to choose "Reading" from the "add a new custom field" and input a second book I’m reading into that value field.
So I had two custom keys there, both called "reading" with different values, a different book each.
On the index.php template I put this:
<br /> <?php the_meta() ; ?>
in the same div as holds the post title and categories the post is filed under, etc. I have it placed underneath all that stuff so that it shows up last.
I published the post and this is the output I got:
"Reading: Pendragon Cycle, Mansfield Park"
This is what it looks like on the Source of the web page:
<br /> <ul class='post-meta'>
<li><span class='post-meta-key'>Reading:</span> Pendragon Cycle, Mansfield Park</li>
Posts that have no custom field entries do not show any of the above last code on the source … so only meta data shows up this way in posts that it’s entered as this thread is stating.
I puzzled over this thread and custom fields a few times the last week, and then decided to tackle it today. It took me 5-minutes to finally read, and implement, so I wanted to write this so that anyone else can figure out how to at least put per-post-meta-data in via custom fields.
It was simple. I look forward to seeing further implementation from plugins and new tags!
UPDATE: This thread on WP’s forums expands on the above. Idahocline on the forum wrote a function for “the_meta” so just using that in my-hacks.php [I use WP 1.2 and have legacy support for my-hacks turned on in options.] gives me the ability to split up the keys on separate lines, and put them anywhere in the post loop that I want, or not show some, though they are still attached to the post. Basically it allow formatting of the keys and values. This functionality is nice, since I’d added a second key to this post, and didn’t want the two keys with their values all on one line smooshed together, as they were. I couldn’t easily figure out how to work with the_meta to do what I wanted, since it’s a new thing — it needs developed further. Isee great value in custom fields, and using them for me can highlight books, music, or whatever, as well as if a post is specially needing to be marked, as I have marked this one with WP HELP since it’s a post totally about “the_meta” tag in WP. This way I’ll be able to, in the future, call up this post in different ways do to custom fields, the_meta. 🙂