Posts

WordPress – Check user has specific role

Sometimes you need to check WordPress user role to grant permission to access certain area of a WordPress Website. WordPress doesn’t have a function for checking the user role. Following piece of code lets to you check user has specific role in WordPress.
Read more

Tips : Woocommerce product category

Here i am adding few tips that helpful while developing or customizing woocommerce pages.

Get product category id in Woocommerce product archive page
Try the following code to get Woocommerce product category id in product archive page(archive-product.php)
Read more

Dynamically populate woocommerce product category terms to WordPress navigation menu

Following is a snippet that lets you dynamically populate woocommerce product category terms to WordPress navigation menu. This code only add sub product category to wordpress navigation menu if the woocommerce parent category already exists in wordpress navigation menu.
Read more