WordPress.org

Support

Support » How-To and Troubleshooting » Custom post type help

Custom post type help

  • d10gen3
    Participant

    @d10gen3

    I’m working on a website for a designer and he needs to publish his portfolio. I created a custom post type called portfolio in which every single item in the portfolio is called a project. Ok, the problem is that i don’t want to put the usual fields that i usually have in a post (excerpt, post content, etc.), what i want is to have the following fields shown when he clicks the add new button:

    – Image
    – URL
    – Description

    I don’t have a problem with the description and the URL, as they are simple custom fields, but the image upload is the one that i can’t find a way to create.

    In my $args variable i have:
    'capability_type' => 'post',
    Is there a way to tell that my custom post type is based on attachment instead of post?, but behaves as a post, so he can upload the file and the custom fields refer to that specific attachment?

    Thanks in advance for your help!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Felix
    Member

    @ffffelix

    You could use the built-in featured image functionality for your image field, or the Advanced Custom Fields plugin.

    d10gen3
    Participant

    @d10gen3

    Ok, how do i use that image field? I want it to be in the center section where the admin can see it, i like the idea but when i activate the

    'supports' => array( 'thumbnail' )

    It adds a box with the title ‘featured image’ way below in the right side bar (below the publish and taxonomy boxes)… and i want it to appear in the top part right in the middle. And I also want to change the box title to ‘Project screenshot’.

    I also would put in a vote for YAPB (Yet Another Photo Blog Plugin) from Yoast, which is an awesome photo-attachment plugin that I adore. I suggest you try it out. In my experience, YAPB works with ALL posts, I don’t know how it would work with Custom Post Types. It is a great plugin for portfolio-type sites.

    YAPB plugin page

    d10gen3
    Participant

    @d10gen3

    Thanks for your suggestion, but this is not really what i want to do. It would be really nice if my intention was to create a beautiful portfolio for my website, but right now all i need to do is show a form to my administrator with the fields that i want:
    – A space to upload the image (which i would gladly do with the built in feature of wordpress if i can adjust it to my desire)
    – And a few custom fields that the administrator needs to fill up.

    Right now everything is working perfect, all i need is to put the image uploader in the content area instead of the sidebar and personalise it’s text and title.

    But I did check the plugin and it is really good!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Custom post type help’ is closed to new replies.