Options and content types
Options pages and content types
Keep a value once, and make new kinds of content with their own fields.
In this chapter
Keep a phone number once and use it everywhere
You want: a phone number that is typed once and shown on every page.
Put an options page inside Settings or Tools
If Ask what to build is on, the first question already offers Its own item in the menu, Inside Settings or Inside Tools. A page can also be a sub page of another options page.
Let editors, not only administrators, use an options page
People with a lower role do not see the page at all. The default for every page is in Settings → General → Who can use options pages, and in code ugly_options_capability changes it. See…
Make a new kind of content
You want: Recipes, Events or Team, with their own menu, with no register_post_type().
Add fields to the new kind of content
The fields appear on the edit screen of every Recipe. List them in your theme with the loop of WordPress, and print each one with ugly_show().
Make a taxonomy, and put fields on its terms
For fields on each term, make a group with the location Taxonomy is Cuisine. They show on the screen of each term. Read one with:
No page matches. Try another word.
Did this article answer your question?
Thank you. It helps us make the documentation better. Need more help?