Search code examples
wordpresscustom-fieldscustom-field-type

Wordpress CUstom Fields Default Fields in Admin View


I have written a ton of custom fields to use with a template, but they are not showing up immediately in the admin view of the Page/Post and I have to manually type in all of the custom field names.

Is there a way to automatically make my fields show in the admin view, so I can immediately choose them from the dropdown?


Solution

  • A better way may be to do the following. Add this to your themes functions.php file http://pastebin.com/NyqS2uPr - Code was rather long, sorry.

    Once you add that, you'll see that under posts there is now a new "custom" menu. Entering items into this will allow you to add custom fields (determined by the code). This is a little cleaner than just having the dropdown as you can pre-determine what the custom field names will be.