Support » Fixing WordPress » Difference between custom fields & custom post types

  • enseignement



    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

Viewing 1 replies (of 1 total)
  • vtxyzzy


    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.

Viewing 1 replies (of 1 total)
  • The topic ‘Difference between custom fields & custom post types’ is closed to new replies.