Sallie Goetsch provides an overview of custom fields and custom metaboxes in WordPress at the November 2012 East Bay WordPress Meetup. (These are the slides that never reached Oakland.)
14. How Do I Display Custom Fields?
THE BASIC WAY
<?php the_meta(); ?>
within the loop will display the key,
followed by the value.
http://codex.wordpress.org/Template_Tag
s/the_meta
15. Displaying Custom Fields,
with Parameters This Time
<?php get_post_custom_values
($key, $post_id); ?>
Lets you choose which custom fields to
display.
16. Displaying Custom Fields
in Genesis Themes
if( $post->post_content != "" ) {
echo "<div class='testimonial-
story'>";
echo "<h3>How the WLC System Worked
for " . genesis_get_custom_field(
'wlc_success_name' ) . "</h3>";
the_content( __( '[Read more...]' ,
'genesis' ) );
echo "</div>";
}
18. Whatâs a Metabox?
Also known as a âwrite panel,â a âmetaboxâ
is one of those nice little boxes in the back
end of WordPress that you use for
entering or controlling content.
Metaboxes let you use radio buttons, date
pickers, file uploads, and other handy UI
elements that custom fields donât. They
make life easier for your clients.
26. Display as Normal Custom Fields
// display speaker bio
echo "<h3>About the
Speaker</h3>";
echo "<div class='speaker-
bio'>";
echo "<p>" .
genesis_get_custom_field( 'wpcf-
speaker-bio' ) . "</p>";
27. Display with Views Plugin
http://wp-types.com/home/views-create-elegant-displays-for-your-content/
NoteâI didnât actually find compiling all these shortcodes a lot easier than
building the templates myself. You still have to style the templates. So after a
little tinkering, I gave up and used Method 2.
28. More Stuff
As always, youâll find links to related
resources, plus a copy of these slides, on
the EastBayWP.com site.
You can find me, your humble presenter
and harried meetup organizer,
@salliegoetsch on Twitter or at
WPFangirl.com.