Need help with permalink rewrites for Custom Post Types with hierarchical relationships

I think it is better to connect with taxonomy terms. Since you can add any custom fields to terms using ACF / another plugin / code, it is possible to use terms with images, full description etc. I had similar task, this tutorial should be helpful https://rudrastyh.com/wordpress/taxonomy-slug-in-post-type-url.html. Yes, I know that there is no hierarchy … Read more

Product subcat with duplicate name of a subcat of another cat gets the category name in the slug

It took me two days to figure this out in the proper way, so I’ll add it here for anyone else that may need it in the future. add_filter(‘wp_unique_term_slug’, ‘prevent_cat_suffix’, 10, 3); function prevent_cat_suffix($slug, $term, $original_slug) { if ($term->post_type == ‘product’ && $term->parent !== 0) { return $original_slug; } return $slug; } As you can … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)