• Hello,

    I am creating a page where i have to use a custom post types. I have 2 problems with create taxonomy archive page.

    1.
    I have a post type named ‘bazan_portfolio’.
    Then i created a taxonomy named ‘technologies’ where i have 3 options: ‘html’, ‘wordpress’, ‘jquery’.

    I have a main archive template in file: archive-bazan_portfolio.php which works pretty well. The adress: http:.address.com/portfolio/ – show all posts in this type, no matter in what technologies post is.

    Now i want to do a taxonomy archive template for every tax term.

    When I open a page: http.address.com/portfolio/wordpress i want to list all posts which are in portfolio(post_type)->technologies(tax_type)->wordpress(tax_term).

    I can do that when go on http.address.com/technologies/wordpress/ it lists all posts in this category, but I want this on /portfolio/wordpress not on /technologies/wordpress/

    how to do it?

    codes i am using:

    function create_post_type() {
    	register_post_type( 'bazan_portfolio',
    		array(
    			'labels' => array(
    				'name' => __( 'Portfolio' ),
    	function create_post_type() {
    	register_post_type( 'bazan_portfolio',
    		array(
    			'labels' => array(
    				'name' => __( 'Portfolio' ),
    				'singular_name' => __( 'Portfolio' )
    			),
    		'public' => true,
    		'has_archive' => true,
    		'rewrite' => array('slug' => 'portfolio'),
    		'capability_type' =>  'post',
         	'public' => true,
         	'show_iu' => true,
         	'hierarchical' => true,
         	'show_in_nav_menus' => true,
    		'supports' => array(
    				  'title',
    				  'editor',
    				  'thumbnail',
    				  )
    		)
    
    	);
    
    	register_taxonomy( 'technologie', 'bazan_portfolio',
    	array(
    			'labels' => array(
    				'name' => __( 'Technologie' ),
    				'singular_name' => __( 'technologie' )
    			),
    			'show_ui'                 => true,
    		    'show_admin_column'       => true,
    		    'update_count_callback'   => '_update_post_term_count',
    		    'query_var'               => true,
    		    'rewrite'                 => array( 'slug' => '/technologie', 'with_front' => false) //change slug for portfolio dont work - conflict with post-type-slug
    		)
    
    	);  // portfolio categories
    
    }
    add_action( 'init', 'create_post_type' );

    2.
    I want to do a menu which list in ul>li all categories with links to /portfolio/tax-slug/

    I have read a lot about custom taxonomies and i cant do it well! I am doing it for several hours!

The topic ‘custom post type taxonomy archive’ is closed to new replies.