开发者

Wordpress CUstom Fields Default Fields in Admin View

开发者 https://www.devze.com 2023-02-05 14:49 出处:网络
I have written a ton of custom fields to use with a templat开发者_JS百科e, 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 f

I have written a ton of custom fields to use with a templat开发者_JS百科e, 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?


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.


While I'll usually add custom fields to the functions.php file, another option I've successfully used before is to add them using a free plugin. The best custom fields plugin I've found is called "More Fields". The More Fields plugin is available on wordpress.org and its very easy to use (and doesn't require any actual coding). There are a few more plugins you can also choose from if you like them better.

It's really your call on if you want to go the .htaccess route or the plugin route. Both have their advantages, but I wanted to at least share the plugin I've had good luck with in the past.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号