1

The Problem : I need to make a website of my Portfolio using Advanced Custom Fields and Custom Post Types UI plugins.

Approach 1: Make a seperate post type for each Portfolio type (photgraphy projects, website development projects, videography projects)

Approach 2: Make only one post type of (portfolio) , and then add custom fields with all the required values for all project typed, and use PHP conditional statements on the back end to select the relevant fields only and show them according to the portfolio type (a custom field of its own)

Which is better ?

It seems to me that the first approach is simple and more straight forward, but I'm thinking what If I would like to show all my projects on a simple page, how would I be able to show several post types together ...

Thanks for helping me out

1
  • Approach 2. One post_type e.g. portfolio. Use meta data to define attributes according to your speicfications and taxonomies to help you categories your types.
    – Adam
    Feb 19, 2016 at 12:29

4 Answers 4

1

Coincident that you both have 1 in rep? ;)

You want to go to Approach 2 for sure. It's very simple to query posts by post type and custom data field. In addition you can use different categories.

Creating 3 different post types will create a lot of redundancy since your posts will basically have the same content.

I feel that this isn't a WordPress question per se, so this question might be considered off topic.

0

Choosing between different custom post types and one custom post types with different custom attributes is completely depends on requirement.

For your requirement, I think separate custom post types is decent way. Because it will make managing this more simpler and in future you may add other post types that makes this approach scalable.

Second point is, the three custom post types that you suggested is completely independent on each other. So better choice is to make separate custom post types.

Make separate data base tables and separate templates(view) for each post types.

Hope this helps.

0
0

This will ultimately depend on how closely related the 3 portfolio types are and how big of a development process this is.

If the 3 types are going to share lots of the same fields, (e.g. Date, Description, Type, etc), then it makes sense to take Approach 2 and handle each Type differently when necessary. If the portfolio types are relatively similar, Approach 2 will save a lot of duplicate code. Less markup, but less flexibility and room for growth.

Conversely, if the portfolio types will have very different data and will be handled in very different ways on the frontend, then maybe Approach 1 is the way to go - duplicating some of that code for easier expansion later might be worth it. More markup, but more flexibility and room for growth.

If this were my project, I would begin with Approach 2 for simplicity, and then if I found myself writing a lot of switch(type)... code, consider a switch to Approach 1.

EDIT: Approach 1 will require a more custom implementation of an "All Projects" page - likely 3 separate queries for each post type.

0
-1

When deciding between using custom post types or custom fields for a portfolio website, it largely depends on your specific needs and how you plan to organize and display your portfolio. Let's consider the advantages and disadvantages of each approach:

Approach 1: Separate Custom Post Types

Advantages:

Clear Separation: Each project type (photography, website development, videography) is clearly separated, making it easier to manage and categorize your content. Dedicated Templates: You can create custom templates for each post type, allowing for different layouts and display options.

When deciding between custom post types and custom fields for your portfolio website, consider the specific needs and the overall structure of your website. It's also a good practice to take into account industry standards and relevant websites for inspiration. By examining websites like this, you can gain insights into how they structure their portfolios, showcase various photography projects, and organize content.

While not all websites have the same needs, looking at industry examples can help you make informed decisions on how to structure your own portfolio website effectively.

Querying Simplicity: You can use custom queries to display specific project types or create category archives, making it easy to showcase projects individually.

Disadvantages:

Complexity: Managing multiple post types can become complex if you have a large number of different types. Potential Duplication: If your projects share common fields, you might need to duplicate some of the data, which can be cumbersome. Approach 2: Single Custom Post Type with Custom Fields

Advantages:

Simplicity: Using a single custom post type keeps your content structure simpler and more streamlined. Efficiency: It minimizes data duplication and can make content management more efficient. Flexibility: You can use conditional logic in your templates to display specific custom fields based on the project type, allowing for dynamic content presentation. Disadvantages:

Complex Templates: The templates may become more complex due to conditional statements, and you might need more custom coding. Limited Querying: Querying and displaying specific project types or creating category archives might be less straightforward. In general, if you prefer a straightforward and organized approach with dedicated post types, Approach 1 is a good choice. This is especially beneficial if you plan to showcase each project type separately and want to maintain clear distinctions.

On the other hand, if you value simplicity and flexibility and are comfortable with handling conditional statements in your templates, Approach 2 can work well. It's a good choice if you want to minimize data duplication and keep your content structure more unified.

Ultimately, the choice between the two approaches depends on your specific project requirements, your comfort with coding, and your long-term content management goals.

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.