3

I am working on Drupal CMS, and Drupal is really grate and hard, and now I am going to learn Wordpress.

Drupal let users to create different content-type, and each content-type can be different type of input or textarea and etc...

for example I have a sport website I can define lots of input[s] and let my editor or user to enter everything what he want, (just for Example) These are the field what I need in drupal:

filed-sport-title (text)
filed-sport-summery (textarea)
field-text-en (textarea)
field-text-translate-fa (textarea)
field-text-subject (radio button)
field-text-images (file > image > number of needed image or unlimited)
field-sport-reference (text)
field-sport-tags (taxonomy)

But I think: in WordPress I should enter all of top field in one editor (WordPress editor). Is this right?

Is there anyway to creating field in WordPress?

1

2 Answers 2

2

Yes there are lot of ways you can achieve this by using plugin or pragmatically

This Plugin will create custom content types as well as custom fields for specific content type: https://wordpress.org/plugins/wck-custom-fields-and-custom-post-types-creator/

However you can also do this via pragmatically: http://code.tutsplus.com/tutorials/a-guide-to-wordpress-custom-post-types-creation-display-and-meta-boxes--wp-27645

You can also check these functions from WordPress Codex which can be helpfull for custom content types and custom fields:

  1. register_post_type This function will add content type for you.
  2. add_meta_box This function can be use for adding multiple fields for specific content types.
  3. save_post This function can be used for saving custom fields in database.
2

WordPress uses Custom Fields (also called post meta on technical side) for storage of arbitrary data, associated with the posts. Note that it is different from Taxonomies, which is also available for respective kind of grouping data.

However, especially in case of custom fields, it doesn't provide much in terms of building custom interfaces for that storage. You can easily add Meta Boxes (containers) to the post editor interface, but natively you would have to implement all the form markup and saving logic yourself.

Because of such historical situation there is extremely wide field of third party custom field frameworks.

In a nutshell you have a choice between:

  1. Native involved implementation, with a lot of custom development and high degree of control/understanding over it
  2. Third party framework, and preceding research of which framework out of dozens is even a fit to your project(s)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.