Created
March 12, 2015 20:25
-
-
Save davereese/fbc5eca64ed9925a4f52 to your computer and use it in GitHub Desktop.
Custom Post Type and ACF Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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