GavernWP WordPress theme framework Quick Tip #8 – Editing labels of Custom Post Fields

Some WordPress plugins use custom post fields to store data associated with specific posts. This can be an issue for some users as the expected presentation of a post may be disrupted by these additions, however others may want this data to be visible to the readers. In this case, there is another big issue – standard custom fields’ labels contain numbers, underscores etc… so they aren’t visually appealing. To counter this issue we have added a new option to easily change custom field labels in the latest version of our framework (more information about this version can be found here). In addition, from this version the custom fields option will be disabled by default. To change the standard, unappealing labels we must first enable custom fields. We can do this through: Dashboard -> Template Options -> Advanced tab -> Custom fields -> Enabled. Then our custom fields will become visible: As an example I’ve added two additional custom post fields named “some_test” and “some_test2”- these custom post fields are displayed under our existing fields: “Post Note”, “Post last updated by” and “Post will be removed on”. As you can see, these additional fields’ labels are not very informative or presentable. So, how do we change these labels? With the GavernWP Framework this is easy to achieve; First we go to the Advanced theme settings and locate the option named “Custom Post Fields label mapping”: In this field, simply enter the label of the fields you wish to change followed by an equals sign (“=“) and your new, preferred label name. Please ensure that each label change is located on a separate line, as in the following example: Now, return to the front-end and take a look at your new, clean presentation: Remember that there is also an option for hiding specific custom post fields, should you wish to have greater control over what custom fields are displayed. Details about this option can be read here: So, the next time you find strange values at the end of your posts, remember these features and know that the issue is easy to fix. Alternatively, If you don’t want any custom post fields to be displayed at all, then all you need to do is leave the “Custom Fields” option disabled. Feel free to test out this quick tip using our Free WordPress Theme – Meet GavernWP.
Rate this post
Share
This article was first published November 11th, 2013