WordPress.org

Ready to get started?Download WordPress

Forums

Post Type (1 post)

  1. mrspabs
    Member
    Posted 10 months ago #

    Hi
    I used the below code to make a custom post type

    if ( ! function_exists( 'post_type_entry' ) ) :
    
    function post_type_entry() {
    
    	register_post_type(
    		'entry',
    		array(
    			'label' => __('Entry Pages'),
    			'description' => __('Create an Entry Page.'),
    			'public' => true,
    			'show_ui' => true,
    			'has_archive' => true,
    			'capability_type' => 'post',
    			'rewrite' => array(
      			'slug' => 'pages' // This controls the base slug that will display before each term
      		),
    			'supports' => array (
    				'title',
    				'editor',
    				'thumbnail',
    				'excerpt',
    				'custom-fields',
    				'revisions',
                                    'page-attributes'
    			)
    		)
    	);
    }
    endif;
    
    add_action('init', 'post_type_entry');
    add_theme_support( 'post-thumbnails', array( 'post','entry' ) );

    I would like for the user to be able to choose the parent page and the template like they can on pages. How do I do that?

Reply

You must log in to post.

About this Topic