hi i manage to change the product category to
http://localhost/products/category/office/seating
but my product is showing
http://localhost/products/product-name
how can i make it to show
http://localhost/products/parent-category/category/product-name
that i assign the product to??
for example
office
– seating
– productA
how can i make it to show
http://localhost/products/office/seating/productA
thank you for your help
wordpress.stackexchange.com/questions/39500/how-to-create-a-permalink-structure-with-custom-taxonomies-and-custom-post-types
tried this method,but still not working
In functions.php add:
//rewrite slug
add_filter('post_type_link', 'waila7_permalink', 10, 3);
function waila7_permalink($permalink, $post_id, $leavename) {
if (strpos($permalink, '%product_category%') === FALSE) return $permalink;
// Get post
$post = get_post($post_id);
if (!$post) return $permalink;
// Get taxonomy terms
$terms = wp_get_object_terms($post->ID, 'product_category');
if (!is_wp_error($terms) && !empty($terms) && is_object($terms[0])) $taxonomy_slug = $terms[0]->slug;
else $taxonomy_slug = 'product-category-missing';
return str_replace('%product_category%', $taxonomy_slug, $permalink);
}
In marketpress.php register_post_type(‘product’..) change rewrite slug :
'rewrite' => array('slug' => '%product_category%', 'with_front' => true),
thank you for your help
solve my problem