1

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?

3
  • 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 Sep 5, 2014 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.
    – Bird87 ZA
    Sep 5, 2014 at 8:35
  • Done. Glad to help. Sep 8, 2014 at 11:34

2 Answers 2

0

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

0

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 .

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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