Skip to content

Instantly share code, notes, and snippets.

@musaghauri
Last active February 20, 2019 13:49
Show Gist options
  • Select an option

  • Save musaghauri/641e57615dd5e726c5a1eb8d821bff23 to your computer and use it in GitHub Desktop.

Select an option

Save musaghauri/641e57615dd5e726c5a1eb8d821bff23 to your computer and use it in GitHub Desktop.
Portfolio Custom Post Type
<?php
// Creates Portfolio Custom Post Type
function portfolio_init() {
$args = array(
'label' => 'Portfolios',
'public' => true,
'show_ui' => true,
'capability_type' => 'post',
'hierarchical' => false,
'rewrite' => array('slug' => 'portfolios'),
'query_var' => true,
'menu_icon' => 'fa-briefcase',
'supports' => array(
'title',
'editor',
'excerpt',
'trackbacks',
'custom-fields',
'comments',
'revisions',
'thumbnail',
'author',
'page-attributes',
)
);
register_post_type('portfolios', $args);
}
add_action('init', 'portfolio_init');
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment