How to Add Custom Fields to WordPress

How to Add Custom Fields to WordPress:-If you are not a tech expert or developer then you might not be familiar with these great tools. However most of you guys have used WordPress custom fields in day-to-day wordpress life even if you don’t know what custom fields in wordpress are.

What are custom WordPress fields? How they help?

In developer words: Custom fields are beneficial fields that allow you to store extra information called “meta-data“using key/value pairs.

In non-technical words: custom fields basically mean that enables you to store additional content. Either you can just keep this information to yourself and display it in back-end editor or you can display it in front-end to your visitors as per your choice.

For example– You have to review a product and you want star ratings out of five.

Without custom fields, You only allowed to write the information into the body of blog post where you review the post.

But using custom fields, you could build a separate input spot where you can select desired rating. SO why using a custom field is better than just writing it into the body posts?

Basically it makes it a lot easier to manage that data. Now, you can:

  • Let people search & filter content by reviews
  • Review & rating always have same styling
  • Easily update review & rating in future.

In fact, a large number of plugins that you use relying on the principles of custom fields or you may also use custom fields in easiest way, like to add some extra information to blogs. For example: you can show-

  • Location from which you’re writing a post
  • Weight you recently lifted at gym
  • Album you’re currently listening or book you’re reading.

In short, custom fields are a big part of wordpress that makes it simpler and flexible to use them.

How to Add Custom Fields to WordPress

Easy to use Custom fields plugin:

  1. Toolset:- Toolset is popular wordpress plugin that enables you to work with custom fields & post types. One of the best thing in toolset in comparison to other plugins is that it can completely eliminate code from equation.

That is, you’ll be able to show custom fields information in simple way.

  1. Advanced Custom Fields:- This is also a popular plugin that enables you to add a variety of new custom field types through a simple and user friendly interface. Also it makes it simple to display custom fields via either Php or shortcodes.
  2. Pods:-  This is a popular framework that helps you with both custom fields types and custom post types. It is a quite easy tool that enables you to show custom fields data using magic tags.
  3. Meta box:- This is another custom fields plugin that operates with an strategy that’s similar to advanced custom fields.

How to use and display WordPress custom fields with toolset:-

All of the above plugins are best but here we are using toolset. Because it makes it easy to add custom fields as well as to take that information and show it on frontend of your site.  To create custom fields you require Types module and to display those fields you want views or layout modules.

Step-1:- Access Custom Fields Interface:-

Once you’ve installed Toolset Types plugin, navigate to new toolset area in WordPress dashboard. From here, find the appropriate post type for your custom fields and click on “Add custom fields” button.

Step 2:- Choose Field Type:-

This will open pop-up window where you can select what type of custom field to add. You’ll need to select the option that connects to the information you want to show.

Step 3:- Configure Field:-

Once you’ve selected the field type, you’ll get numerous options to configure it. You don’t need to fill every field but you’ll want to enter a name at least and pursue the rest of options. The conditional display option is a neat feature that allows you to display different fields based on other fields.

Step 4:- Repeat and Save:-

Now, just repeat the process for all custom fields that you want to add. When you’re finished, give a name to your field group and click save field group.

Step5:- Add Custom Field Data in WordPress editor:-

Once you save field group, you’ll get a new meta box in WordPress editor where you can add data in your custom fields.

Step6:- Display on Front-end:

To make the information shown on your front-end , you have to make use of Toolset’s views or layouts modules.