ankurt
Member
Posted 8 months ago #
I have search high and low for some basic documentation. I'm not talking in-depth, just something simple to show you how to get off the ground displaying your plugins.
Do the authors of the plugin think we're supposed to figure out the template tags ourselves? How...?
http://wordpress.org/extend/plugins/more-fields/
Danno040
Member
Posted 8 months ago #
Not a bad question.
I think they just expected you to notice that it puts all of its data as post meta info, and you would just use the normal get_post_meta functions to retrive them.
If you want to throw a quick example together, I'd be happy to add it to the fork on GitHub.
ankurt
Member
Posted 8 months ago #
Yes-- I eventually figured it out. I can throw up a quick Gist in a sec...
ankurt
Member
Posted 8 months ago #
Danno040
Member
Posted 8 months ago #
Great. I'm in the middle of something, but I will work it into the Read Me very soon.
alexandruv
Member
Posted 8 months ago #
Hello everyone,
I also could use some help using this plugin as I am not a very good php programmer.
Following the link posted by @ankurt I assume that if I create a Field called say "Technical specs" I can then add this to my code:
echo get_post_meta(get_the_ID(), 'technical_specs', 1 ); - and it will work?
Any help appreciated,
Alex
Danno040
Member
Posted 8 months ago #
One thing to remember: you have to make sure the "Custom Field Key" is technical_specs. Otherwise, it won't work.
Also, ankurts snippet works only if you are inside "The Loop".
ankurt
Member
Posted 8 months ago #
@alexandruv
Yes.
The "1" means return a string as opposed to an array.
http://codex.wordpress.org/Function_Reference/get_post_meta
EDIT: yes, only works inside loop because of get_the_ID(), but you can swap this with $post->ID or use any ID you want.
alexandruv
Member
Posted 8 months ago #
Danno040
Member
Posted 8 months ago #
I have added a "Working with More Fields in templates" to the readme.
As always, any additions you'd like to make would be welcome.