How to have this permalink structure: post_type/postname/custom_inner_page

Register your taxonomy first and set the argument slug and rewrite rules to your slug which is city Register your post type with slug of your taxonomy city prefixed and make sure you set the has_archive argument to taxonomy. Now add a filter to post_type_link to make the stores show the individual permalink. register_post_type( ‘city’, … Read more

Permalinks: display just one kind of wp category in the posts url

Two things need to be done. First, make your posts URL is different using the post_link filter. function _20170117_post_link( $url, $post, $leavename ) { if( in_category( ‘news’, $post) ) { $url = get_site_url() . ‘/news/’ . $post->post_name ; } return $url; } add_filter( ‘post_link’, ‘_20170117_post_link’, 10, 3 ); Second, make the rewrite rule for this: … Read more

Remove custom post type slug from URL and add taxonomy Slug

You can set up simple tax/cpt permalinks with the rewrite argument when you register the post type: function wpd_product_brand_types() { register_taxonomy( ‘brand’, ‘product’, array( ‘rewrite’ => array( ‘slug’ => ‘brand’, ‘with_front’ => false ) ) ); register_post_type( ‘product’, array( ‘label’ => ‘Products’, ‘public’ => true, ‘supports’ => array( ‘title’ ), ‘rewrite’ => array( ‘slug’ => … Read more