Why is this is_page conditional not working?

“Bangles” isn’t a page. It’s a Product Category Archive. is_page() checks:

Is the query for an existing single page?

Which product categories are not. See the Template Hierarchy to get an idea of the different types of ‘pages’ in WordPress.

If you want to check if you are viewing a product category archive, use is_tax(), which checks:

Is the query for an existing custom taxonomy archive page?

So you would use it like this:

if ( is_tax( 'product_cat', 'bangles' ) ) {

}

WooCommerce also provides its own conditional tags, including a function for checking product categories, is_product_category():

if ( is_product_category( 'bangles' ) ) {

}

Regarding your edit, has_term is also incorrect. That function is for checking if an individual post has the bangles category. On an archive this will be checking the first post/product in the list. While this will be true on the Bangles category page, since all the products in that category have that category, it could also be true on other categories if a product in that category also happens to be in the Bangles category.

The important thing here is that WordPress serves up different types of content, primarily Posts and Archives, and there are different types of posts and archives. In WordPress a ‘Page’ is a type of post. So are products. If you want to check which ‘page’ (in the web browser sense of the word) you need to know which type of content you are looking for and use the appropriate function.

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