Changing product permalink
-
Hi Team
I’m looking to try and change the permalink of my products to /%custom_category%/productname – not quite sure of how to insert the additional string in. I found a post which mentioned changing the rewrite array slug to remove ‘product’ (which I’ve done, as below) – but I’m not sure which string / element to edit to insert the category into the permalink instead. Grateful for any help.
register_post_type( 'grid_products', array( 'labels' => array( 'name' => __( 'Products' ), 'singular_name' => __( 'Product' ), 'add_new' => _x('Add New Product', 'Product'), 'add_new_item' => __('Add New Product'), 'edit_item' => __( 'Edit Product'), 'view_item' => __('View Product'), 'add_new_item' => __( 'Add Product') ), 'public' => true, 'menu_position' => 10, 'menu_icon' => plugins_url( 'images/product_edit.png', __FILE__ ), 'show_ui' => true, 'capability_type' => 'post', 'rewrite' => array( 'slug' => 'post', 'with_front' => false ), 'taxonomies' => array( 'Products '), 'supports' => array( 'title', 'editor', 'excerpt', 'revisions', 'thumbnail', 'custom-fields', 'author', )
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Changing product permalink’ is closed to new replies.