WordPress.org

Support

Support » Plugins and Hacks » Advanced Custom Fields » Wich Plugin to generate Custom Post Types works best with ACF?

Wich Plugin to generate Custom Post Types works best with ACF?

Viewing 3 replies - 1 through 3 (of 3 total)
  • A very simple solution

    create your very own highly custom post types that work perfectly with ACF without needing any plugin.

    Put this in your template’s functions.php file

    Just change the labels to what you need and you are good to go

    add_action( 'init', 'create_clients' );
    function create_clients() {
    	 $labels = array(
        'name' => _x('Clients', 'post type general name'),
        'singular_name' => _x('Client', 'post type singular name'),
        'add_new' => _x('Add New', 'Client'),
        'add_new_item' => __('Add new Client'),
        'edit_item' => __('Edit client'),
        'new_item' => __('New client'),
        'view_item' => __('View client'),
        'search_items' => __('Search clients'),
        'not_found' =>  __('No clients found'),
        'not_found_in_trash' => __('No clients found in Trash'),
        'parent_item_colon' => ''
      );
    
      $supports = array('title',  'page-attributes');
    
      register_post_type( 'clients',
        array(
          'labels' => $labels,
          'public' => true,
          'supports' => $supports,
          'hierarchical' => true
        )
      );
    }

    [Moderator Note: Please post code snippets between backticks or use the code button. As it stands, your posted code may now have been permanently damaged/corrupted by the forum’s parser.]

    Hi IoanPokorny,
    thanks for your answer, but actually I know how to create CPT with code.

    I just think that for most productions (not all of them) it’s best to use a plugin for doing this routine task.

    The scene offer quite a choiche of plugins for creating CPT that looks good and work well, I just would like to know ACF dev’s opinion, if they had try some of them.

    I would definitely say Custom Post Type UI.

    But as I experienced it, using register_post_type is always trouble free since there is always some annoyances with some missing or buggy plugin functionalities.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Wich Plugin to generate Custom Post Types works best with ACF?’ is closed to new replies.
Skip to toolbar