Note that there are some explanatory texts on larger screens.

plurals
  1. POHave more than one custom post type
    text
    copied!<p>I'm building a WordPress theme and want to add custom post types. I've look online but can't seem to find an answer. </p> <p>Now I have this code in the functions.php</p> <pre class="lang-php prettyprint-override"><code>add_action( 'init', 'register_cpt_tutorial' ); function register_cpt_tutorial() { $labels = array( 'name' =&gt; _x( 'Tutorials', 'tutorial' ), 'singular_name' =&gt; _x( 'Tutorial', 'tutorial' ), 'add_new' =&gt; _x( 'Add New', 'tutorial' ), 'add_new_item' =&gt; _x( 'Add New Tutorial', 'tutorial' ), 'edit_item' =&gt; _x( 'Edit Tutorial', 'tutorial' ), 'new_item' =&gt; _x( 'New Tutorial', 'tutorial' ), 'view_item' =&gt; _x( 'View Tutorial', 'tutorial' ), 'search_items' =&gt; _x( 'Search Tutorials', 'tutorial' ), 'not_found' =&gt; _x( 'No tutorials found', 'tutorial' ), 'not_found_in_trash' =&gt; _x( 'No tutorials found in Trash', 'tutorial' ), 'parent_item_colon' =&gt; _x( 'Parent Tutorial:', 'tutorial' ), 'menu_name' =&gt; _x( 'Tutorials', 'tutorial' ), ); $args = array( 'labels' =&gt; $labels, 'hierarchical' =&gt; false, 'description' =&gt; 'Tutorials description will be here', 'supports' =&gt; array( 'title', 'editor', 'thumbnail', 'comments' ), 'taxonomies' =&gt; array( 'category' ), 'public' =&gt; true, 'show_ui' =&gt; true, 'show_in_menu' =&gt; true, 'menu_position' =&gt; 20, 'show_in_nav_menus' =&gt; true, 'publicly_queryable' =&gt; true, 'exclude_from_search' =&gt; false, 'has_archive' =&gt; true, 'query_var' =&gt; true, 'can_export' =&gt; true, 'rewrite' =&gt; true, 'capability_type' =&gt; 'post' ); register_post_type( 'tutorial', $args ); } </code></pre> <p>If I copy and past this code and change the 'tutorials' to 'video' it does not make a second post type. Can someone please help me?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload