php - Wordpress: how to add custom post category to the permalink -
i'm using cherry framework. , theme includes custom post type: portfolios , i've created 2 categories under post type: readers stories(slug: readers-stories) , readers tips(slug: readers-tips).
when create post under portfolios , assign them 1 of category(ex: readers stories) permalink post this:
mysite.com/portfolios/example_post
but want url be:
mysite.com/portfolios/readers-stories/example_post
how can achieve this?
i tried use custom post type permalinks plugin. did not desired result.
here register_post_type
function portfolios post type:
register_post_type( 'portfolio', array( 'label' => theme_locals("portfolio"), 'singular_label' => theme_locals("portfolio"), '_builtin' => false, 'public' => true, 'show_ui' => true, 'show_in_nav_menus' => true, 'hierarchical' => true, 'capability_type' => 'page', 'has_archive' => true, 'menu_icon' => get_template_directory_uri() . '/includes/images/icon_portfolio.png', 'rewrite' => array( 'slug' => 'portfolio', 'with_front' => false, ), 'supports' => array( 'title', 'editor', 'thumbnail', 'excerpt', 'custom-fields', 'comments') ) ); register_taxonomy('portfolio_category', 'portfolio', array('hierarchical' => true, 'label' => theme_locals("categories"), 'singular_name' => theme_locals("category"), "rewrite" => true, "query_var" => true)); register_taxonomy('portfolio_tag', 'portfolio', array('hierarchical' => false, 'label' => theme_locals("tags"), 'singular_name' => theme_locals("tag"), 'rewrite' => true, 'query_var' => true));
Comments
Post a Comment