WordPress.org

Ready to get started?Download WordPress

Forums

Post Type file name? (2 posts)

  1. estevancarlos
    Member
    Posted 3 years ago #

    I've created a post type but can not view page itself. My post type is called "weeklytips". However when I try to view the page it defaults to my index.php. I've created a weeklytips.php but it still goes to the index.php.

    How do I fix this?

    add_action( 'init', 'word_post_types' );
    function word_post_types() {
    	register_post_type( 'weeklytips',
    		array(
    			'labels' => array(
    				'name' => __( 'Weekly Tip' ),
    				'singular_name' => __( 'Weekly Tip' ),
    				'add_new' => __( 'Add New' ),
    				'add_new_item' => __( 'Add New Weekly Tip' ),
    				'edit' => __( 'Edit' ),
    				'edit_item' => __( 'Edit Weekly Tip' ),
    				'new_item' => __( 'New Weekly Tip' ),
    				'view' => __( 'View Weekly Tip' ),
    				'view_item' => __( 'View Weekly Tip' ),
    				'search_items' => __( 'Search Weekly Tip' ),
    				'not_found' => __( 'No Weekly Tips found' ),
    				'not_found_in_trash' => __( 'No Weekly Tips found in Trash' ),
    				'parent' => __( 'Parent Weekly Tip' )
    			),
    			'public' => true,
    			'supports' => array( 'title', 'editor', 'excerpt', 'thumbnail', 'custom-fields' ),
    			'taxonomies' => array( 'post_tag', 'category'),
    			'rewrite' => true,
    			'query_var' => true
    		)
    	);
    	register_taxonomy_for_object_type('category', 'weeklytips');
  2. estevancarlos
    Member
    Posted 3 years ago #

    *bump*

    Any opinions on this?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags