如何修复WordPress中未显示的自定义字段

Are you unable to find the custom fields option on your WordPress site? Custom field is an advance WordPress feature that helps you add custom content to your WordPress posts and pages by following various WordPress tutorials. In this article, we will show you how to easily fix custom fields not showing issue in WordPress.

您是否无法在WordPress网站上找到自定义字段选项? 自定义字段是WordPress的一项高级功能,可通过遵循各种WordPress教程来帮助您将自定义内容添加到WordPress帖子和页面中。 在本文中,我们将向您展示如何轻松修复自定义字段,而不在WordPress中显示问题。

Fix missing custom fields in WordPress
修复WordPress中未显示自定义字段的问题 (Fixing Custom Fields Not Showing Issue in WordPress)

Custom fields are typically associated with WordPress post, pages, or custom post types. Often you will find custom fields mentioned in various WordPress tutorials around the web, but you will likely not see the custom fields option on your site specially if you recently started your WordPress blog.

自定义字段通常与WordPress帖子,页面或自定义帖子类型相关联。 通常,您会在网络上的各种WordPress教程中找到自定义字段,但是特别是在最近启动WordPress博客的情况下 ,您可能不会在网站上看到“自定义字段”选项。

In the past, custom fields were visible by default on the post edit screen of all WordPress sites. However since it is an advance feature, the WordPress core development team decided to hide custom fields by default for all new users in the WordPress 3.1 release.

过去,默认情况下,自定义字段在所有WordPress网站的帖子编辑屏幕上都是可见的。 但是,由于它是一项高级功能,因此WordPress核心开发团队决定默认为WordPress 3.1版本中的所有新用户隐藏自定义字段。

They also made it easy for anyone to make them visible with just two clicks from within the post edit screen.

它们还使任何人都可以轻松地通过帖子编辑屏幕中的两次单击使它们可见。

Simply create or edit an existing post / page, and then click on the ‘Screen Options‘ button at the top right corner of the screen. This will show you a menu with several options that you can show or hide on your post edit screen.

只需创建或编辑现有的帖子/页面,然后单击屏幕右上角的“ 屏幕选项 ”按钮即可。 这将显示一个带有几个选项的菜单,您可以在帖子编辑屏幕上显示或隐藏它们。

Go ahead and click on the checkbox next to ‘Custom Fields’ option.

继续并单击“自定义字段”选项旁边的复选框。

Show custom fields

Note: If you don’t see the Custom Fields option on your site, then please scroll to the troubleshooting option below in the article.

注意:如果您在网站上没有看到“自定义字段”选项,请滚动到本文下面的“故障排除”选项。

You can now scroll down on the post edit screen, and you will notice a new meta box labeled ‘Custom Fields’ below your post editor.

现在,您可以在帖子编辑屏幕上向下滚动,您会在帖子编辑器下方看到一个新的标有“自定义字段”的元框。

Custom Fields box

Since WordPress remembers your display choice, it will continue to display the custom fields box whenever you are editing posts on your website.

由于WordPress会记住您的显示选择,因此当您在网站上编辑帖子时,它将继续显示自定义字段框。

You can use this box to add, edit, and delete custom fields and their values.

您可以使用此框添加,编辑和删除自定义字段及其值。

什么是自定义字段? 你能和他们做什么? (What are Custom Fields? What Can You Do with them?)

By default, when you write a new post, page, or any content type, WordPress saves it into two different areas. The first part is the body of your content that you add using the post editor.

默认情况下,当您编写新的帖子,页面或任何内容类型时,WordPress会将其保存到两个不同的区域。 第一部分是使用帖子编辑器添加的内容主体。

The second part is the information about that particular content. For example, title, author name, date / time, and more. This bit of information about the post is called metadata.

第二部分是有关该特定内容的信息。 例如,标题,作者姓名,日期/时间等。 有关帖子的信息称为元数据。

Apart from the default post metadata, WordPress also allows you to save custom metadata by using custom fields.

除了默认的帖子元数据外,WordPress还允许您使用自定义字段保存自定义元数据。

To learn more, see our beginner’s guide to WordPress custom fields with examples, tips, and tricks that you can use on your website.

要了解更多信息,请参阅我们的WordPress自定义字段初学者指南,其中包含您可以在网站上使用的示例,技巧和窍门。

WordPress developers use custom fields to store custom post metadata for your posts. For example, the Yoast SEO plugin uses custom fields to store SEO settings for your posts.

WordPress开发人员使用自定义字段来存储帖子的自定义帖子元数据。 例如, Yoast SEO插件使用自定义字段存储帖子的SEO设置。

Yoast SEO meta box

However instead of using the default custom fields box shown above, these plugin developers create their own custom meta boxes. This makes it easier for users to input information.

但是,这些插件开发人员没有使用上面显示的默认自定义字段框,而是创建了自己的自定义元框。 这使用户更容易输入信息。

If you want to create a custom meta box to easily input custom metadata, then see our guide on how to add custom meta boxes in WordPress.

如果要创建自定义元框来轻松输入自定义元数据,请参阅有关如何在WordPress中添加自定义元框的指南。

故障排除 (Troubleshooting)

Recently one of our readers came to us with a problem where the Custom Fields option was missing from the WordPress screen options. After some investigation, we were able to find the cause of the issue.

最近,我们的一位读者向我们提出了一个问题,即WordPress屏幕选项中缺少“自定义字段”选项。 经过调查,我们能够找到问题的原因。

If your WordPress site is missing the custom fields option under the ‘Screen Options’ menu, then you need to check if you have the Advanced Custom Fields (ACF) plugin active on your site.

如果您的WordPress网站缺少“屏幕选项”菜单下的“自定义字段”选项,则需要检查网站上是否有“ 高级自定义字段(ACF)”插件处于活动状态。

ACF is a very popular WordPress plugin that developers use to create custom meta boxes. ACF is running on over 1 million websites.

ACF是一个非常流行的WordPress插件,开发人员可以使用它创建自定义的meta框 。 ACF在超过一百万个网站上运行。

In ACF version 5.5.13, they added a setting to remove the default WordPress custom field metabox to speed up the load times on the post edit page. The idea being that you shouldn’t need the default metabox since you’re using ACF.

在ACF 5.5.13版中,他们添加了一个设置以删除默认的WordPress自定义字段元框,以加快后编辑页面上的加载时间。 这样的想法是,由于您使用的是ACF,因此您不需要默认的metabox。

However if you need to have the default WordPress custom field metabox enabled, then you need to add the following code to your WordPress theme’s functions.php file.

但是,如果需要启用默认的WordPress自定义字段metabox,则需要将以下代码添加到WordPress主题的functions.php文件中。

add_filter('acf/settings/remove_wp_meta_box', '__return_false');

This will solve the custom fields option missing issue in WordPress.

这将解决WordPress中缺少自定义字段选项的问题。

We hope this article helped you fix the custom fields not showing issue on your WordPress site. You may also want to see our ultimate list of most useful WordPress tips, tricks, and hacks.

我们希望本文能帮助您解决自定义字段,使其在WordPress网站上不显示问题。 您可能还希望查看我们的最终列表,其中包括最有用的WordPress技巧,窍门和hacks

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

如果您喜欢这篇文章,请订阅我们的YouTube频道 WordPress视频教程。 您也可以在TwitterFacebook上找到我们。

翻译自: https://www.wpbeginner.com/wp-tutorials/how-to-fix-custom-fields-not-showing-in-wordpress/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值