How to rewrite custom post type with custom taxonomy urls?

When you are adding a custom taxonomy you are able to declare a rewrite slug – $labels = array( ‘name’ => _x(‘Name’, ‘taxonomy general name’), ‘singular_name’ => _x(‘Singular Name’, ‘taxonomy singular name’), ‘search_items’ => __(‘Search Items’), ‘all_items’ => __(‘All Names’), ‘parent_item’ => __(‘Parent Item’), ‘parent_item_colon’ => __( ‘Parent Ites:’), ‘edit_item’ => __(‘Edit Item’), ‘update_item’ => … Read more

Custom post types and permalinks

I’m not really sure whats going on here – havent done too much with rewrites like this. But should this: $newRules[‘content/(.+)/(.+)/?$’] = ‘index.php?content=$matches[2]’; $newRules[‘content/(.+)/?$’] = ‘index.php?campus=$matches[1]’; Be This?: $newRules[‘content/(.+)/(.+)/(.+)/?$’] = ‘index.php?content=$matches[3]’; $newRules[‘content/(.+)/(.+)/?$’] = ‘index.php?campus=$matches[2]’; To Match: /content/peoria/new-visitor/children/ /content/peoria/connect/next-generation/children/ ?

Custom post types, taxonomies, and permalinks

Change slug in your post type arguments to products/%product_cat%, and slug in your taxonomy arguments to just products, then flush your rewrite rules. WordPress should now handle /products/my-product-cat/post-name/! Now finally, we need to help WordPress a little with generating permalinks (out of the box, it won’t recognise the permastruct tag %product_cat%): /** * Inject term … Read more

Page as a child of a Custom Post Type

When you register the post type you can set hierarchical to true. hierarchical (boolean) (optional) Whether the post type is hierarchical (e.g. page). Allows Parent to be specified. The ‘supports’ parameter should contain ‘page-attributes’ to show the parent select box on the editor page. Default: false Note: this parameter was planned for Pages. Be careful, … Read more