WordPress.org

Ready to get started?Download WordPress

Forums

Post types / taxonomies intersections
Archive templates not working (3 posts)

  1. Axenstar86
    Member
    Posted 2 years ago #

    Hi,

    I created my CPT as follows:

    register_post_type( 'reviews',
    		array(
    			'labels' => array(
    				'name' => __( 'Reviews' ),
    				'all_items' => __( 'Review √úbersicht' ),
    				'singular_name' => __( 'Review' ),
    				'add_new' => __( 'Neue Review' ),
    				'add_new_item' => __( 'Neue Review verfassen' ),
    				'edit_item' => __( 'Review bearbeiten' ),
    				'new_item' => __( 'Neue Review' ),
    				'view_item' => __( 'Review ansehen' ),
    				'search_items' => __( 'Reviews durchsuchen' ),
    				'not_found' =>  __( 'Keine Review gefunden' ),
    				'not_found_in_trash' => __( 'Keine Review im Papierkorb gefunden' ),
    				'parent_item_colon' => ''
    			),
    			'public' => true,
    			'publicly_queryable' => true,
    			'show_ui' => true,
    			'query_var' => true,
    			'rewrite' => array('slug' => 'metal-review','with_front' => false),
    			'capability_type' => 'post',
    			'hierarchical' => false,
    			'menu_position' => null,
    			'supports' => array( 'title', 'editor', 'author', 'thumbnail'),
    			'has_archive' => true
    	)
    	);

    The archive template has the name "archive-reviews-mytax.php".
    Unfortunately I am getting redirected to index.php all the time.

    Any help would be appreciated.

    http://wordpress.org/extend/plugins/post-types-taxonomies-intersections/

  2. Axenstar86
    Member
    Posted 2 years ago #

    Ok problem solved:

    the custom post type has been registered in a wrong way, I had to change the hierachical from false to true.

    'hierarchical' => true,

  3. Axenstar86
    Member
    Posted 2 years ago #

    -solved-

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.