WordPress.org

Ready to get started?Download WordPress

Forums

Difference between custom fields & custom post types (2 posts)

  1. enseignement
    Member
    Posted 3 years ago #

    Hello,

    Could someone explain me the big differences between custom fields & custom post types ?
    I mean, I would like to know the pros & cons of the 2 systems.

    I'm trying to set up a gallery with various things (pictures, links, videos, audio, etc.) and I would like to make sure to do the right choices.

    Thanks for your help

  2. vtxyzzy
    Member
    Posted 3 years ago #

    Custom Fields (CFs) and Custom Post Types (CPs) are so different that it is not possible to compare pros and cons of the two.

    WP by default has two post types: post and page. A CP is another post type that behaves like one of these two except that you have to provide your own code to show or search them.

    A CF is a piece of data attached to a post.

    For example, a car dealer's site might have a CP for 'car'. Each of the cars in his inventory would have a post of this type.

    Now, each car has a make, model, year, price, color, etc. These could be CFs attached to each car post. This would allow unique values for these to be assigned to a given car post.

    Hope that helps to clarify the terms.

Topic Closed

This topic has been closed to new replies.

About this Topic