I have few custom field assigned for each post, like:
“Club” with value “club1”
“Date” with value “date1”
and so on…
Now, I want to display from all the custom fields just those 2 ” club” and “date”.
This is my markup :
<div class="meta-container"><?php the_meta(); ?></div>
The problem with this, is that is retrieving all the custom fields and I don’t want this.
I was thinking to add css psedoselector like nth:child(n) but I’m sure that I can do this with this function.
Thank you!
You should use
get_post_meta()
twice (Ref to your other question):Oddly enough, one of your tags is exactly what you need! You’re looking for WordPress’ get_post_meta function:
http://codex.wordpress.org/Function_Reference/get_post_meta
Within the loop, it would look something like this: