WordPress Tutorials - Smashing Magazine.pdf

(5721 KB) Pobierz
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
Imprint
Published in November 2011
Smashing Media GmbH, Freiburg, Germany
Cover Design: Ricardo Gimenes
Editing: Andrew Rogerson, Talita Telma
Proofreading: Andrew Lobo, Iris Ljesnjanin
Reviewing: Je ! Starr
Idea and Concept: Sven Lennartz, Vitaly Friedman
Founded in September 2006, Smashing Magazine delivers useful and
innovative information to Web designers and developers. Smashing
Magazine is a well-respected international online publication for
professional Web designers and developers. Our main goal is to support the
Web design community with useful and valuable articles and resources,
written and created by experienced designers and developers.
ISBN: 9783943075199
Version: December 16, 2011
845763653.003.png
Preface
You've probably already gathered a lot of knowledge on how to improve
your WordPress skills, but applying this on your own might be a complicated
process. Reading this Smashing eBook #12: WordPress Tutorials will
facilitate putting all this knowledge into practice. Through the accurate
methods which were exclusively selected by our editorial team, you will
certainly acquire the expertise you need for your future WordPress
publishing projects without any complications.
For instance, you will learn not only how to create custom post meta boxes,
but also to use them with any post type, handle with data validation, save
custom meta data and retrieve meta data on the front-end. Besides, you will
be able to design tabs on WordPress setting pages and develop native
administrative tables the right way.
Two exclusive sections show that it is possible to go beyond simple posts
and pages. You will learn how to establish a media site and how to manage
it on a WordPress website. In the first part, the focus is on setup custom post
types and custom taxonomies ― without plugins. The second part focuses
more on using custom taxonomy templates to organize and relate media.
And last but not least, a detailed introduction on how to perform using an
open-source software called bbPress is included, which was originally
created as a standalone alternative for forums.
The articles have been published on Smashing Magazine in 2010 and 2011,
and they have been carefully edited and prepared for this eBook.
We hope that you will find this eBook useful and valuable. We are looking
forward to your feedback on Twitter or via our contact form .
— Andrew Rogerson, Smashing eBook Editor
Smashing eBook #12ᴹWordPress Tutorials ᴹ 3
845763653.005.png
How To Create Custom Post Meta Boxes
In WordPress
Justin Tadlock
What seems like one of the most complicated bits of functionality in
WordPress is adding meta boxes to the post editing screen. This complexity
only grows as more and more tutorials are written on the process with weird
loops and arrays. Even meta box “frameworks” have been developed. I’ll let
you in on a little secret though: it’s not that complicated.
Smashing eBook #12ᴹWordPress Tutorials ᴹ 4
845763653.006.png 845763653.001.png
Creating custom meta boxes is extremely simple, at least it is once you’ve
created your first one using the tools baked into WordPress’ core code. In
this tutorial, I’ll walk you through everything you need to know about meta
boxes:
Creating meta boxes.
Using meta boxes with any post type.
Handling data validation.
Saving custom meta data.
Retrieving custom meta data on the front end.
Note: When I use the term “post” throughout this tutorial, I’m referring to a
post of any post type, not just the default blog post type bundled with
WordPress.
What is a post meta box?
A post meta box is a draggable box shown on the post editing screen. Its
purpose is to allow the user to select or enter information in addition to the
main post content. This information should be related to the post in some
way.
Generally, two types of data is entered into meta boxes:
Metadata (i.e. custom fields),
Taxonomy terms.
Of course, there are other possible uses, but those two are the most
common. For the purposes of this tutorial, you’ll be learning how to develop
meta boxes that handle custom post metadata.
Smashing eBook #12ᴹWordPress Tutorials ᴹ 5
845763653.002.png
Zgłoś jeśli naruszono regulamin