Skip to content

Instantly share code, notes, and snippets.

@davereese
Created March 12, 2015 20:25
Show Gist options
  • Save davereese/fbc5eca64ed9925a4f52 to your computer and use it in GitHub Desktop.
Save davereese/fbc5eca64ed9925a4f52 to your computer and use it in GitHub Desktop.
Custom Post Type and ACF Example
<?php
// Register Custom Post Types
add_action('init', 'register_custom_posts_init');
function register_custom_posts_init() {
// Register Products
$products_labels = array(
'name' => 'Products',
'singular_name' => 'Product',
'menu_name' => 'Products'
);
$products_args = array(
'labels' => $products_labels,
'public' => true,
'capability_type' => 'post',
'has_archive' => true,
'supports' => array( 'title', 'editor', 'excerpt', 'thumbnail', 'revisions' )
);
register_post_type('products', $products_args);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment