0

I'm pretty new to wordpress (been using wordpress for a week now) and took over a site from a colleague of mine . He partially created a plugin to input "Specials" onto the site. At the moment, the fields that it shows is "Title", and "Body" with a featured image. This is what the code looks like:

public function create_specials_type()
{
    register_post_type('specials',
        array(
            'labels' => array(
                'name' => __('Specials'),
                'singular_name' => __('Specials')
            ),
            'public' => true,
            'has_archive' => true,
            'supports' => array(
                'title',
                'editor',
                'thumbnail',
                'revisions'
            ),
            'show_ui' => true,
            'show_in_menu' => true
        )
    );

    add_theme_support('post-thumbnails',
        array(
            'specials'
        )
    );
}

I want to modify this so that it shows a page (on the admin side) that looks like this:

Special Name (input) Description (textarea) Items (textarea) Cost (input) Image (image)

I'm using WP 3.9.2 with a custom theme. Can anyone assist me with writing this plugin or at least provide a link to a good resource that will help me do this?

  • 1
    For beginner the easiest way to create custom fields for post types is ACF -plugin advancedcustomfields.com If you need to create custom post types I would recommend Types -plugin that actually has custom field builder too (not as neat as ACF though) wordpress.org/plugins/types – jounileander Sep 5 '14 at 8:05
  • Please make this an answer. This made my life so much easier I think I might just die... - EDIT: Worst part is, the plugin (ACF) was already installed. It's just the way my colleague set it up made it insanely difficult to work with. When that was figured out... easy. – Albert Sep 5 '14 at 8:35
  • Done. Glad to help. – jounileander Sep 8 '14 at 11:34
1

For beginner the easiest way to create custom fields for post types is ACF -plugin advancedcustomfields.com If you need to create custom post types I would recommend Types -plugin that actually has custom field builder too (not as neat as ACF though) wordpress.org/plugins/types

| improve this answer | |
1

To generate custom post , custom taxonomy and custom metabox (admin input field). I suggest you to use two plugins

1 . Custom Post Type UI (https://wordpress.org/plugins/custom-post-type-ui/ ) for registering custom post and taxonomy 2. Advance Custom Field ( https://wordpress.org/plugins/advanced-custom-fields/ ) for creating meta box (admin input panel) , it supports several type of input field like text , number , file , image , map , date picker , colorpicker even complex relational post object and conditional logic.

Hope these will help you .

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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